Quoting none <for...@gimpusers.com>:

> Sorry, i got another question. I want to find the width of each character by
> essentially "cropping" the cell. But this bit of code in the script saulgoode
> gave me:
> (gimp-rect-select image x y width height ...)
> (set! bounds (gimp-selection-bounds image))
> just seems to get the width and height of the selection, which is obviously
> known since it's used to set the selection in the first place!

Since the operation mode of 'gimp-rect-select' is  
CHANNEL-OP-INTERSECT, the resulting selection is only the  
non-transparent part of all chars that lie within the region of that  
cell (i.e., the non-transparent part of a single char).

This is the opposite order of what you may have been expecting -- that  
is, to select a cell and THEN select the non-transparent part of the  
cell -- but the net result is the same! It was simpler to do it my way  
because the "Alpha To Selection" function  
('gimp-selection-layer-alpha') does not allow for CHANNEL-OP modes.

Gimp-user mailing list

Reply via email to