Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to quickly know layer dimensions in Gimp?

Every time I want to know the layer dimensions in Gimp, I open the "Scale layer" dialog to get it. Is there a better way to know this at a glance? May be some configuration option to show it at the bottom/right of the layer name, or in the bottom bar...

Maybe this could be a Gimp feature request?

Thank you!

like image 822
minterior Avatar asked Aug 04 '13 10:08

minterior


1 Answers

GIMP does have ways to configure the status bar (on prefences, image windows, title and status) - but there is currently no way to display the layer size -

It can be made a feature request - on one hand it is an easy task, and someone starting to trying to collaborate with the project might tackle it. Ont he other hand, the project suffers from lack of man power for development, and on the road map, there is already getting rid of "layer dimensions" altogether (in the future they should just expand/contract automatically, with options at export time for fixing sizes when needed). Anyway, it would be worth to reaquest this as a feature at bugzilla.gnome.org

What is possible to do programmatically now, is to write a small python script that would open its own GTK Window with text entry widgets, and set a main loop on the script (python Plug-ins in GIMP run in a separate process, so it is ok for they to have their own main loop) - to call at certain intervals something along:

layer = pdb.gimp_image.get_active_layer(img) width = layer.width; height = layer.height

And having those values fed to your window. The "img" parameter will be passed when you start the plug-in,a nd you will have to run one instance of it for each working image. (there is no PDB call to get the active image in GIMP).

UPDATE After the bug request open by the OP, the feature was implemented in the development branch of GIMP and is available as %x and %y codes to be used in the status/title bar in the GIMP git master (edit->preferences->Image Windows->Title & Status). It should be available from GIMP 2.10 onwards.

UPDATE I found out there is no easy way to get to know the available codes for status bar, short of checking the source code. So I am pasting them here:

%f: base filename
%F: full filename
%p: PDB id
%i: instance
%t: image type
%T: drawable type
%s: user source zoom factor
%d: user destination zoom factor
%z: user zoom factor (percentage)
%D: dirty flag
%C: clean flag
%B: dirty flag (long)
%A: clean flag (long)
%m: memory used by image
%M: image size in megapixels
%l: number of layers
%L: number of layers (long)
%n: active drawable name
%P: active drawable PDB id
%W: width in real-world units
%w: width in pixels
%H: height in real-world units
%h: height in pixels
%u: unit symbol
%U: unit abbreviation
%X: drawable width in real world units
%x: drawable width in pixels
%Y: drawable height in real world units
%y: drawable height in pixels
%o: image's color profile name
%e: view offsets in pixels
%r: view rotation angle in degrees

(Please note that some of those may not available in GIMP 2.8)

like image 155
jsbueno Avatar answered Sep 28 '22 02:09

jsbueno