Hello IMers.

I have a 32x32 pixel RGBA image (in TGA format).  It contains 4 colors,
namely:

  Colors: 4
  Histogram:
       528: ( 74,  0, 61,212) #4A003DD4 rgba(74,0,61,0.831373)
       445: ( 74,  0, 61,211) #4A003DD3 rgba(74,0,61,0.827451)
        48: ( 74,  0, 61,210) #4A003DD2 rgba(74,0,61,0.823529)
         3: ( 74,  0, 61,209) #4A003DD1 rgba(74,0,61,0.819608)

If I do "convert -colors 256 -type TrueColorMatte input.tga output.tga",
then I'd expect output.tga to look at least very similar to input.tga.
In a perfect world they'd be pixel-perfect copies.  As it is, I'm
getting some unexpected behaviour.

On IM 6.3.4 06/14/07 Q16 (Windows), it zeroed the RGB (but not A) parts
of the first color, leaving me with:

Colors: 4
  Histogram:
       528: (  0,  0,  0,212) #000000D4 rgba(0,0,0,0.831373)
       445: ( 74,  0, 61,211) #4A003DD3 rgba(74,0,61,0.827451)
        48: ( 74,  0, 61,210) #4A003DD2 rgba(74,0,61,0.823529)
         3: ( 74,  0, 61,209) #4A003DD1 rgba(74,0,61,0.819608)

I downloaded the latest IM (6.3.5 07/28/07), and interestingly I got a
different result.  It did the same as 6.3.4, and also threw away one of
the other colors:

Colors: 3
  Histogram:
       528: ( 74,  0, 61,211) #4A003DD3 rgba(74,0,61,0.827451)
       489: (  0,  0,  0,212) #000000D4 rgba(0,0,0,0.831373)
         7: ( 74,  0, 61,209) #4A003DD1 rgba(74,0,61,0.819608)

Here are some relevant points:

I've previously read and understood the information at
http://www.imagemagick.org/Usage/quantize/#quantize_not_exact, about
'pure' colors not being preserved, but I don't think my image falls into
that category.

I know that the command I'm running looks a bit silly in this context.
However, the image I'm dealing with is just one of a huge set that I'm
iterating over.  Some (most) of them have more than 256 colors.

I don't think the file format is relevant.  I tried converting the file
to a PNG beforehand and got the same result.

I can send the image to anybody who is interested.  It's only 4K, but I
know that attachments to mailing lists can be unpopular.

Is the behaviour I'm seeing a bug, or an unavoidable part of the
quantization process?

Thanks in advance for any pointers,

Peter Pimley






__________________________________________________________________________________________________________________________________________
Information contained in this e-mail is intended for the use of the addressee 
only, and is confidential and may be the subject of Legal Professional 
Privilege.  Any dissemination, distribution, copying or use of this 
communication without prior permission of the addressee is strictly 
prohibited.The views of the author may not necessarily constitute the views of 
Kuju Entertainment Ltd. Nothing in this email shall bind Kuju Entertainment Ltd 
in any contract or obligation.

The contents of an attachment to this e-mail may contain software viruses which 
could damage your own computer system. While Kuju Entertainment has taken every 
reasonable precaution to minimise this risk, we cannot accept liability for any 
damage which you sustain as a result of software viruses. You should carry out 
your own virus checks before opening the attachment.

Kuju Entertainment Ltd trading as Zoe Mode

Registered Office : 10 Woodside Park, Catteshall Lane, Godalming, Surrey, UK, 
GU7 1LG. Company Number : 3481384. Company Registered in England.
__________________________________________________________________________________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
_________________________________________________________________________________________________________________________________________

_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to