plug-in-sample-colorize

Wolfgang Hofer

Description

Colorize image using a sample image as a guide

Help

This plug-in colorizes the contents of the specified (gray) layer with the help of a sample (color) layer. It analyzes all colors in the sample layer. The sample colors are sorted by brightness (== intentisty) and amount and stored in a sample colortable (where brightness is the index) The pixels of the destination layer are remapped with the help of the sample colortable. If use_subcolors is TRUE, the remapping process uses all sample colors of the corresponding brightness-intensity and distributes the subcolors according to their amount in the sample (If the sample has 5 green, 3 yellow, and 1 red pixel of the intensity value 105, the destination pixels at intensity value 105 are randomly painted in green, yellow and red in a relation of 5:3:1 If use_subcolors is FALSE only one sample color per intensity is used. (green will be used in this example) The brightness intensity value is transformed at the remapping process according to the levels: out_lo, out_hi, in_lo, in_high and gamma The in_low / in_high levels specify an initial mapping of the intensity. The gamma value determines how intensities are interpolated between the in_lo and in_high levels. A gamma value of 1.0 results in linear interpolation. Higher gamma values results in more high-level intensities Lower gamma values results in more low-level intensities The out_low/out_high levels constrain the resulting intensity index The intensity index is used to pick the corresponding color in the sample colortable. If hold_inten is FALSE the picked color is used 1:1 as resulting remap_color. If hold_inten is TRUE The brightness of the picked color is adjusted back to the origial intensity value (only hue and saturation are taken from the picked sample color) (or to the input level, if orig_inten is set FALSE) Works on both Grayscale and RGB image with/without alpha channel. (the image with the dst_drawable is converted to RGB if necessary) The sample_drawable should be of type RGB or RGBA


Type

unknown

Parameters

Type Name Description
PF_INT run-mode The run mode { RUN-INTERACTIVE (0), RUN-NONINTERACTIVE (1) }
PF_IMAGE image Input image (unused)
PF_DRAWABLE dst-drawable The drawable to be colorized (Type GRAY* or RGB*)
PF_DRAWABLE sample-drawable Sample drawable (should be of Type RGB or RGBA)
PF_INT hold-inten hold brightness intensity levels (TRUE, FALSE)
PF_INT orig-inten TRUE: hold brightness of original intensity levels. FALSE: Hold Intensity of input levels
PF_INT rnd-subcolors TRUE: Use all subcolors of same intensity, FALSE: use only one color per intensity
PF_INT guess-missing TRUE: guess samplecolors for the missing intensity values FALSE: use only colors found in the sample
PF_INT in-low intensity of lowest input (0 <= in_low <= 254)
PF_INT in-high intensity of highest input (1 <= in_high <= 255)
PF_FLOAT gamma gamma correction factor (0.1 <= gamma <= 10) where 1.0 is linear
PF_INT out-low lowest sample color intensity (0 <= out_low <= 254)
PF_INT out-high highest sample color intensity (1 <= out_high <= 255)

Return

None