-remap makes *almost* everything grayscale?

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
midn
Posts: 1
Joined: 2019-05-05T02:35:19-07:00
Authentication code: 1152

-remap makes *almost* everything grayscale?

Post by midn »

I have ~300 frames I had rendered on Blender, and I wanted to palettize those frames and turn them into a single GIF.

Here's the palette image (it's a crop of a palette image I found on Wikipedia).
Image

Here's my command.

Code: Select all

convert +dither -remap "/home/midnightas/cpp/TMRP/bin/assets/palette.png" -delay 1x24 -verbose f*.png gif.gif
But every color except for one is grayscale. The output may give some hint.

Code: Select all

f0001.png=>gif.gif[0] PNG 640x360 640x360+0+0 8-bit Palette Gray 510=>7c 7583.3518518518521887/0.016130/0.200000db 9.153MB 1851.760u 4:19.149
I've also tried modulating to increase the saturation, thinking that maybe the color distance function is getting it "wrong", but it did not fix the issue.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: -remap makes *almost* everything grayscale?

Post by snibgo »

But what is the problem? Your map has pixels that mostly have very high saturation. If your input is an ordinary photo, most pixels will be low saturation, so those pixels will be closer to a gray than a high saturation.

If you want a non-gray output, try removing "+dither". Then the errors in mapping each pixel will accumulate, so more pixels are likely to need mapping to a high-saturation colour.

Or you could decrease the saturation of the map image, or increase the saturation of each input *.png.

Also: your map has 399 unique colours. A GIF can record only 256 colours, so IM will do further colour reduction after the map. I suggest using a map with only 256 colours.

Also: your IM command should be in the logical order: read the inputs, then "-remap", then write the outputs.
snibgo's IM pages: im.snibgo.com
Post Reply