How to use Imagick php to generate a bmp file with a palette offset -


I am trying to use iMagic to generate 8bit bmp from jpg via phag. But I would like to start pixel colors on index 16 compared to 0. In the code given below, how do I generate BMP in the correct format, but the palette index is missing from 0. Is there a way to ensure that the palette starts in another index?

$ average = new emacs ("icon.jpg"); $ Average-> setCompression (Imagick :: COMPRESSION_NO); $ Average-> quantizeImage (32, Imagick :: COLORSPACE_RGB, 0, wrong, incorrect); Image coloring (average, 0, 255, 255, 255); $ Average-> set format ("bmp"); Header ("content-type: image / bmp"); Rebound $ average; $ Average-> Clear (); $ Average-> Destroy (); I do not think Imagick has anything built for it, so you have to create a new palette (offset). Copy the old one with) and then use the $ pixel = $ average :: getImagePixelColor () and then $ pixel-> Getcolor ()

and $ pixel-> Set color () according to the new palette.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -