Unusual result while using GetPixel

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
gaimrox
Posts: 11
Joined: 2012-05-24T15:34:58-07:00
Authentication code: 13

Unusual result while using GetPixel

Post by gaimrox » 2013-01-10T19:22:49-07:00

Hi,

I am right now using PerlMagick to iterate through the pixels of an image. I'm doing something super basic - just taking an image, iterating through the pixels and outputting the result as an HTML table. We've all seen this before... but I'm running into a problem.

So basically if I parse the pixels AFTER performing a "Write" operation, the GetPixel call returns back the expected data, and I then can generate a correct HTML Table that represents my image. However if I remove that "Write" call, the results are messed up. Basically the color information appears to be in the wrong format or something.

I compared the two different results, and they are quite different. I'm sure I'm doing something wrong, setting some type of output format or something that Write() must be performing... but I cannot find it in the docs anywhere.

Ideas?

thanks in advance!

gaimrox
Posts: 11
Joined: 2012-05-24T15:34:58-07:00
Authentication code: 13

Re: Unusual result while using GetPixel

Post by gaimrox » 2013-01-16T13:55:57-07:00

I seemingly answered my own question today. Appears that you need to define the quantum depth when working on an image stream - the library apparently doesn't just "know" the quantum depth.

Oddly this is a non-issue when writing a file.

Post Reply