phMagick color plugin

phMagick :: color functions

 

phMagick as a few color manipulation functions, see how they change this image

 

 

darken

<?php
 $p = new phmagick('original.png', 'destination.png');
 $p->darken(55);
?>

brigthen

<?php
 $p = new phmagick('original.png', 'destination.png');
 $p->brighten(55);
?>

grey scale

<?php
 $p = new phmagick('original.png', 'destination.png');
 $p->toGreyScale();
?>

invert colors

<?php
 $p = new phmagick('original.png', 'destination.png');
 $p->invertColors();
?>

sepia

<?php
 $p = new phmagick('original.png', 'destination.png');
 $p->sepia();
?>

auto levels

<?php
 $p = new phmagick('original.png', 'destination.png');
 $p->autoLevels();
?>

5 thoughts on “phMagick color plugin

  1. phMagick: Error executing “convert -sepia-tone 90% -modulate 100,50 -normalize -background “none” “DSC_6734copy1.JPG” “dest/destination.JPG”"
    return code: 1
    command output :”convert: unrecognized option `-sepia-tone’.”

  2. Nice code! This really simplified a script I was working on, it did in 5 min what took me 2 hours yesterday using GD.
    Only problem I can see is that it strips the color profile. The average person might not notice on most images, but as a photographer I notice right away. The vibrancy in the reds and yellows are gone from images with Adobe color profile (the browser shows the original picture with color profile). I know this only effects modern browsers.
    I want to edit the convert function to take account color profiles, but not yet familiar with imagemagick. This post on SO makes me think it is possible: http://stackoverflow.com/questions/2130196/how-do-i-remove-exif-tags-while-preserving-the-icc-color-profile, but I’m not sure how to extract the color profile…

  3. I fixed my color space problem above by removing “$cmd .= ‘ -strip ‘;” from the resize function, works perfect now, thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>