You are here

Translate into Palette

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!
translate-into-palette.zip3.43 KB

Gino D's GIMP Scripts:


This script creates a new palette derived from the visible area or from the active drawable (layer or channel) of the current image.

The peculiarity of the generated palette is that it is displayed in the Palette Editor as a faithful representation of the original image contents in the form of a rectangular array of suitable colors. The display area of the palette will feature even the same aspect ratio as the selected part of the image in case the color entries are horizontally and vertically scaled in such a way as to appear square.

Activating the script

Once installed, you can find this script in the image window menu under
"Image -> Translate into Palette...".


Source to capture
Allows you to decide whether to derive the palette from the visible area of the active image or from the active layer or channel, possibly by restricting the capture to the region overlapping the bounding box of the selection, if there is one in the image.
Reproduce non-opaque areas
Here you can determine the way in which the transparent and semi-transparent areas that may be present in the image shall be represented in the resulting palette.
  • Using background color:
    the color entries of the palette corresponding to the non-opaque pixels will be produced by replacing the transparency with the background color of the Toolbox.
  • Using foreground color:
    same as above, but using the foreground color of the Toolbox.
  • Discarding transparency:
    the non-opaque pixels will be captured and represented as if they were fully opaque, that is by ignoring the alpha channel information.
Interpolation method
Lets you select the method of interpolation to use for translating the selected region into the array of discrete colors whereby the new palette will be rendered in the Palette Editor.
The available methods are: None, Linear, Cubic, Lanczos.
Palette name
Here you can set the name of the new palette, which otherwise, if leaving the text box empty, will automatically take the name of the source image.
Number of columns
Defines the number of columns used to display the new palette in the Palette Editor, while the number of rows (and consequently the amount of color entries) is automatically determined by requiring that the ratio of rows to columns is equal to the ratio between the width and the height of the captured area.
Values can range from 1 to 64.
Do not exceed 256 colors
When this checkbox is activated, the generated palette will have no more than 256 colors, that is the upper limit for GIF files and indexed images. If necessary, the script will automatically reduce the specified number of columns (and the number of rows proportionally) in order to comply with such restriction.
Save palette in
Allows you to choose whether to save the palette in the 'palettes' folder of your personal GIMP directory or in the 'palettes' folder inside the GIMP's system directory. In the former case, unlike the latter, it will be possible to modify the generated palette in the Palette Editor as well as delete it by using the special button or the corresponding menu command available in the Palettes Dialog.
Delete last created palette
Here you can decide what to do with the last created palette, that is the one generated in the most recent execution of the script.
  • If derived from current image:
    the last created palette will be deleted only if it turns out to be derived from the same image to which the script is currently applied.
  • In any case:
    the aforesaid palette will be deleted in any case, regardless whether it is derived from the current image or another.
  • No:
    the aforesaid palette will not be eliminated.

Note that the automatic deletion of the most recently generated palette is an useful strategy which avoids overloading the Palettes Dialog with an excessive amount of new palettes, such as those which would normally be created by executing the script several times during a same GIMP session.

Code License: 
GIMP Version: 
Scripting Engine: 
Subscribe to Comments for "Translate into Palette"