Bug: -colors option slows to a crawl for high color values
Posted: 2012-01-01T13:51:19-07:00
There seems to be a boundary point at 16*BD*331=84,736 (for a bit depth of 16, with a max BD of 16). If passed a -colors option above this point, it will immediately process all of the colors up to that point and then VERY SLOWLY increment by one, even going down a bit before eventually going up. (This is according to -monitor.) Example:
In this case, the bit depth is 64, but the boundary point still appears to be BD=16 -> 84,736. If given a bit depth of 8, the boundary is 42,368. The number 331 cannot be a coincidence, so I'm guessing that it's somehow linked to a color mapping table using the web-safe palette as some sort of starting point. Another example:
Even with a -colors 84736 option, it will still get stuck at that mark because there are more than 84.7K colors in the appended image. If I add "-depth 8 +depth" right after the -append, it will get stuck at "70036 of 98418". If I tell it to reduce it down to 1 million colors, it STILL tries to reduce the colors, even though the entire set of unique colors is lower than that!
My goal here is to: Convert to 64-bit Lab colorspace, resize the animation frames to a fixed 315x177, append all of the frames together (which would give me something on the order of 900K colors), reduce that footprint to around 131K colors, take that color map from the appended image and apply it to the actual frames. Then save to a MIFF file.
Code: Select all
$ convert anim000.pam \( -intent Perceptual -depth 64 -colorspace Lab -resize 315x177\! \) -monitor -append -colors 131072 -colorspace sRGB -format "%r - %k - %z" info:
mogrify image[anim000.pam]: 17 of 18, 100% complete
append image sequence[anim000.pam]: 17 of 18, 100% complete
classify image colors[anim000.pam]: 3185 of 3186, 100% complete
reduce image colors[anim000.pam]: 84910 of 125108, 67% complete
Code: Select all
p$ convert anim000.pam -intent Perceptual +depth -colorspace Lab -resize 315x177\! -depth 8 -colorspace sRGB -monitor -append +dither -colors 131072 -identify -format "%r - %k - %z" info:
mogrify image[anim000.pam]: 17 of 18, 100% complete
append image sequence[anim000.pam]: 17 of 18, 100% complete
Transform/Image[anim000.pam]: 3185 of 3186, 100% complete
classify image colors[anim000.pam]: 3185 of 3186, 100% complete
reduce image colors[anim000.pam]: 42586 of 79110, 53% complete
My goal here is to: Convert to 64-bit Lab colorspace, resize the animation frames to a fixed 315x177, append all of the frames together (which would give me something on the order of 900K colors), reduce that footprint to around 131K colors, take that color map from the appended image and apply it to the actual frames. Then save to a MIFF file.