String of pixels to image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Jasmina

String of pixels to image

Post by Jasmina »

Hi,
I have width, height and string with RGB values for all pixels for one image($width,$height and $pixelString) . How can I create image from these values using ImageMagick?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

You did not specify which language interface you want to use. With MagickWand, use MagickReadImageBlob() but first call MagickSetFormat() to set the format to "RGB".
Jasmina

Post by Jasmina »

I use PHP to export information for every pixel from Flash (pixel color = 0xRRGGBB value) to $pixelString. I use ImageMagick with "exec", never used MagickWand before. How I can use this string to generate a picture?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

See the imagemagick 'txt:' enumerated pixel format...
http://www.cit.gu.edu.au/~anthony/graph ... files/#txt
this lets you feed a stream of pixels, one line per pixel, to create the image from.

You can also feed the pixels (in sequence) using a netPBM format (text or binary)
http://www.cit.gu.edu.au/~anthony/graph ... ts/#netpbm
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Jasmina

Post by Jasmina »

Thank you.

Jasmina
Post Reply