[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: what the number of colors message from lintian means

On Tuesday 10 February 2004 05:39 am, Georg Neis wrote:
> * Filippo Rusconi <rusconi@mnhn.fr> wrote:
> > I have a menu icon that is 32x32 pixels, that I have indexed using The
> > Gimp, asking that it be made of 24 colors. When I package the software
> > I get the following error message:
> It seems that this error is no longer relevant:
> Subject: lintian: check for menu-icon-has-bad-colors should be removed
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=199341

Even so, it seems worth explaining how to do it:

Note: "bad colors" not "too many colors" -- this was obviously a check that
the icon was displayable on a display with fixed colors.  You'd need to
specifically set the available colors and convert the pixmap to that color

ImageMagick will do it like so:

1) Create an image with only the desired colors, and save that in a palette format (such
as gif).  Save this as, say "safepalette.gif".  (You can do this interactively in ImageMagick,
though programs like "xpaint" make it easier, Gimp can do it too, of course, though it's
sort of overkill).

2) Open the image you want to convert in "display" (or "ImageMagick" on the menu).

3) Select "enhance -> map ..."

4) Choose the safepalette.gif image as the one to take the palette from.

5) Save the converted image as the icon you will use.

A new image with the colors converted to match the palette is produced.

In Gimp, it's less obvious, but might be easier in the long run, using the
same safepalette.gif as above:

1) Menu "File -> Dialogs -> Palette . . ."

2) Button "Edit"

3) Button "New" and specify a name such as "safe palette"

4) Button "Import" and select your "safepalette.gif"  This will load the palette.

5) Load the image you want to change.  Right-click menu "Image -> Mode -> Indexed ..."
(Note that if the image was already indexed, you'd need to first choose
"Image -> Mode -> RGB").

6) Select "Use Custom Palette . . ." . You probably also want "No Color Dithering" but
that's a matter of taste.

7) Click on the available palette (Was "Web" when I tried it), this gives you a palette
selection dialog -- pick the new one you created.  Now your image is converted
to the desired palette.

This is more complicated for one image, but we created a palette we can use
on a whole series of images, so it might save time in the long run.  OTOH, with
ImageMagick's "convert" utility we could've batched it into a script (but read the
man page for how to do that, "man ImageMagick", "man convert"), and processed
hundreds of images (or put it into the Debian rules to process upstream icons).

This was necessary for icons used in 8-bit window managers where you
wanted the color palette to be stable.  Most people use true-color
 (24-bit color) nowadays, so it's not so important.


Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks  http://www.anansispaceworks.com

Reply to: