Stephan Hennig on wrote...
| Anthony Thyssen schrieb:
| > Stephan Hennig on wrote...
| > |
| > | convert bluebells_darker.jpg -colorspace Gray -colors 64 c.png
| > |
| > | For different arguments to '-colors <col>' I get the following results:
| > |
| > | <col> colours in image
| > | 1 1
| > | 2 2
| > | 3 3
| > | 4 - 15 4
| > | 16 - 63 8
| > | 64 - 254 16
| > | 255 64
| > |
| > The colors quantization algorithm uses a tree basied segmentation method
| > to cluster colors together until it gets less than the maximum number of
| > colors needed.
| >
| > Often there can be a sudden jump in the resulting number of colors when
| > the colors do not cluster very well. That is a lot of very distinct
| > colors.
|
| I wouldn't expect such pathological behaviour for the test file
| bluebells_darker.jpg. The file can be found in
| ImageMagick-6.3.7-Q8\images\.
|
|
| > Also there is a second phase to the -colors algorithm where once the
| > colors have been selected the image needs to be transformed to use those
| > colors. This process is called 'mapping' or 'dithering'. However the
| > alogorithms that do this may not in fact use all the colors found by the
| > quantization algorithm!!!
|
| Converting bluebells_darker.jpg to grey scale alone returns an image
| with 255 colours:
|
| convert bluebells_darker.jpg -colorspace Gray grey.png
|
| I can't believe the best approximation of this image with 254 colours
| should result in 16 colours, but with IM it does:
|
| convert grey.png -colors 254 grey254.png
|
prehaps you should use a Q16 version of IM instead of Q8
this has a higher quality internally, in which case you get a larger
variable of the greyscaling operation, for the quantization to play
with, and thus a finer control.
Also do it all in one command (with the Q16 version)
convert bluebells_darker.jpg -depth 16 \
-quantize gray -colors 254 grey254.png
Anthony Thyssen ( System Programmer ) <[EMAIL PROTECTED]>
-----------------------------------------------------------------------------
What are the facts? Again and again and again -- what are the _facts_?
Shun wishful thinking, ignore divine revelation, forget what 'the stars
foretell', avoid opinion, care not what the neighbors think, never mind
the unguessable 'verdict of history', -- what are the facts, and to how
many decimal places? You pilot always into an unknown future; facts are
your only clue. Get the facts! -- Lazuras Long, (Aka. Robert Heinlein)
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users