note 108512 added to imagick.solarizeimage

From: Date: Wed, 02 May 2012 22:10:59 +0000
Subject: note 108512 added to imagick.solarizeimage
Groups: php.notes 
Request: Send a blank email to php-notes+get-187448@lists.php.net to get a copy of this message
This is something neat that you can do to an image as part of making it artistic, probably in conjunction with other ImageMagick effects, like PosterizeImage and OilPaintImage. SolarizeImage shifts the whole color spectrum toward red for an image -- white gets pushed directly into red, blues get pushed into greens, etc.. It is mostly a psychedelic effect. You have the option of choosing one parameter for "Threshold", which is really simply how much of this effect you want to have in an image. The minimum value is 0, and using a negative number defaults it to 0. The maximum value is the Quantum Threshold. You can get this value by the ImageMagick function getQuantumRange. On my install of PHP, that value is set to 65535 (2^16). Going higher than the Quantum Range defaults to the Quantum Range. An image with this function performed on it at Threshold 0 has the maximum effect performed, and at Threshold maximum the image has no changes made to it at all. And now a simple demonstration of the code : <?php // Author: holdoffhunger@gmail.com // Grab Image File Data // --------------------------------------------- $file_to_grab_with_location = "graphics_engine/image_workshop_directory/test.bmp"; $imagick_type = new Imagick(); // Open File // --------------------------------------------- $file_handle_for_viewing_image_file = fopen($file_to_grab_with_location, 'a+'); $imagick_type->readImageFile($file_handle_for_viewing_image_file); // Perform Function // --------------------------------------------- $imagick_type->solarizeImage(30000); // Filename // --------------------------------------------- $file_to_save_with_location = "graphics_engine/image_workshop_directory/test_new.bmp"; // Save File // --------------------------------------------- $file_handle_for_saving_image_file = fopen($file_to_save_with_location, 'a+'); $imagick_type->writeImageFile($file_handle_for_saving_image_file); ?> ---- Server IP: 69.147.83.197 Probable Submitter: 68.9.137.178 ---- Manual Page -- http://www.php.net/manual/en/imagick.solarizeimage.php Edit -- https://master.php.net/note/edit/108512 Del: integrated -- https://master.php.net/note/delete/108512/integrated Del: useless -- https://master.php.net/note/delete/108512/useless Del: bad code -- https://master.php.net/note/delete/108512/bad+code Del: spam -- https://master.php.net/note/delete/108512/spam Del: non-english -- https://master.php.net/note/delete/108512/non-english Del: in docs -- https://master.php.net/note/delete/108512/in+docs Del: other reasons-- https://master.php.net/note/delete/108512 Reject -- https://master.php.net/note/reject/108512 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#187448) next »