RSS/Atom feed Twitter
Site is read-only, email is disabled

changing canvas size and ImageWidth and ImageHeight jpeg properties

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

changing canvas size and ImageWidth and ImageHeight jpeg properties WarrenDodge 27 Aug 00:34
  changing canvas size and ImageWidth and ImageHeight jpeg properties rich2005 27 Aug 08:09
2017-08-27 00:34:27 UTC (over 6 years ago)
postings
1

changing canvas size and ImageWidth and ImageHeight jpeg properties

First I am new to using gimp. So please bear with me. I have taken a jpeg picture which had a width of 979 and height of 698 I then added some text outside the current canvas across the bottom. I kept the text shorter than the width. I then use the image->fit canvas to layer command and the canvas size increased to include the text I added. The increased part of the canvas was checkerboard indicating transparent and that caused issues depending on the view I used. That may have been only on .tif files and not jpeg.

I then used the image-> flatten image command to hopefully remove the transparent part of the canvas. Visually the checkerboard went away with my text being on a solid background.

I then overwrote the file with the file command.

Now if I look at the canvas size it is 979 x 758 which is an increase of 60 which is about right for the .15" text I added.

I wrote a perl script to look at the jpeg ImageHeight and ImageWidth attribute values. When I do this with the image I get 979 and 698, which is the original values, rather than 979 and 758.

Is something wrong with the process or is it a gimp problem or ??

Beyond an answer to the above my end goal at this point is to adjust 400 pictures to have a 4x6 or 6x4 aspect ration by adjusting the canvas size and not by cropping the current picture. I may be missing a way to do this that is hopefully easy.

rich2005
2017-08-27 08:09:01 UTC (over 6 years ago)

changing canvas size and ImageWidth and ImageHeight jpeg properties

First I am new to using gimp. So please bear with me. I have taken a jpeg picture which had a width of 979 and height of 698 I then added some text outside the current canvas across the bottom. I kept the text shorter than the width. I then use the image->fit canvas to layer command and the canvas size increased to include the text I added. The increased part of the canvas was checkerboard indicating transparent and that caused issues depending on the view I used. That may have been only on .tif files and not jpeg.

I then used the image-> flatten image command to hopefully remove the transparent part of the canvas. Visually the checkerboard went away with my text being on a solid background.

I then overwrote the file with the file command.

Now if I look at the canvas size it is 979 x 758 which is an increase of 60 which is about right for the .15" text I added.

I wrote a perl script to look at the jpeg ImageHeight and ImageWidth attribute values. When I do this with the image I get 979 and 698, which is the original values, rather than 979 and 758.

Is something wrong with the process or is it a gimp problem or ??

Beyond an answer to the above my end goal at this point is to adjust 400 pictures to have a 4x6 or 6x4 aspect ration by adjusting the canvas size and not by cropping the current picture. I may be missing a way to do this that is hopefully easy.

There is a few questions there. At first I wondered what you were doing. Adding text that way must be partly guesswork. Is it make a large text box then add 'returns' to get the text under the image?

What happens then is the text layer is resized but the base layer remains the same, see that by the dotted boundary indicator when a layer is active. Guessing, this is what your script picks up. screenshot 1

A better way is increase the canvas size first. screenshot 2 Then text can be positioned easily. (hint: keep the text box dynamic, move using ctrl-alt )

A perl script? What OS - linux perhaps. Are you trying to script your procedure? Gimp has its own built-in scripting. Perl was used long ago, I have a couple of .pl scripts in my archive somewhere, but script-fu (scheme) or python is more usual. If I was doing this, Gimp would not be first choice, ImageMagick for that quantity or with Gimp, there are batch plugins.

Image Formats, jpeg does not support transparency. png usually when transparency is required. These are 'final' exported formats. Always Save your work as Gimp .xcf which keeps all layers, guides, text-as-text, ..etc.

rich: www.gimp-forum.net