Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can GIMP export in tif format without aplha channel?
#1
A little more than a year ago I posted this topic regarding tif files created by GIMP.

I've now noticed something else about such files which I find strange.  It seems possible that this could contribute to some compatibility issues discussed therein.  However, compatibility is NOT the only issue.

It now looks to me like GIMP is adding an alpha channel NO matter what I do.  For example, I can open a tif format file created by another program and according to GIMP there is no alpha channel.  Then I do nothing but export that file from GIMP in tif format.  When I subsequently open that file in GIMP it says there is an alpha channel.  Furthermore, the newly created alpha channel does nothing.  It appears to be completely opaque (i.e., complete white, no transparency).  Obviously I don't know what is causing the compatibility problem but I do think I should be able to create a tif file without said alpha channel which would be a format more like what other image editors I'm using do.

Another problem I've noticed with tif files created by GIMP is that they are much larger than what other software would produce for the same image.  The tif file created by GIMP is approximately 1/3 larger than it needs to be.  The experiment mentioned above where I just opened (input) a tif file and exported it in tif format  is that the file grew from 60MB to 80MB.  Given that it went from 3 channels (RGB) to 4 (RGBa) that seems like this explains the phenomenom.

What I've been doing for some time now which is quite annoying is opening the files I produce with GIMP using some other editor (typically Rawtherapee), which fortunately is able to open them, and then exporting them again without doing any editing and the resulting file turns out to be about 75% the size of the GIMP produced input file.

It seems like GIMP should be able to omit the alpha channel.  I'm hoping I just need someone to explain how that can be done.
Reply
#2
Which Gimp version? What settings? On my Gimp 2.10.14, with no compression, a 400x400 image with a single layer without alpha channel exports as a 664K file, and reloads in Gimp without getting an alpha-channel. Adding an alpha-channel makes it a 820K file.

Edit: this is confirmed by ImageMagick's identify that says:  tiff:alpha: unspecified for the image without alpha and tiff:alpha: unassociated for the image with alpha.

PS: Can you attach a (small) TIFF from an image without alpha channel in Gimp?
Reply
#3
(02-16-2020, 01:23 PM)Ofnuts Wrote: Which Gimp version? What settings? On my Gimp 2.10.14, with no compression, a 400x400 image with a single layer without alpha channel exports as a 664K file, and reloads in Gimp without getting an alpha-channel. Adding an alpha-channel makes it a 820K file.

Edit: this is confirmed by ImageMagick's identify that says:  tiff:alpha: unspecified for the image without alpha and tiff:alpha: unassociated for the image with alpha.

PS: Can you attach a (small) TIFF from an image without alpha channel in Gimp?

GIMP 2.10.12 is the newest I have.  However, this phenomenon has been going on for a long time that I've been using GIMP and certainly has existed in all of the 2.10.? versions I've used which is probably at least 5 different releases.

When exporting to tif I specify no compression, include all metadata, uncheck save layers and save thumbnail.

With GIMP I can create a small (400x400) image by copying such a selection from a real picture.  However, because I'm doing this with GIMP I have no way of opening such a file that was NOT created by GIMP.  I do notice when I create a new 400x400 image, with transparent background, GIMP says it has an alpha channel.  So I pasted the 400x400 selection copied from another image and then deleted the alpha channel.  When I export that as tif the result is a file that is 626.04KB according to XnViewMP.  Apparently that is too big to be attached here.  However, I can take that file and open it in Rawtherapee (5.4) and export it from there in tif format which produces a file that is 493.93KB which is attached.  If I then open that file in GIMP it indicates that there is no alpha channel.  However, if I now open the file created by GIMP in GIMP it says there is an alpha channel even though as stated above I purposely deleted the alpha channel before exporting.

Another factor is that of the 2 files referenced above the one created by GIMP cannot be opened by the software supplied with my cameras, Canon Digital Photo Profession R4 (DPP4), whereas the file created by Rawtherapee can be opened and processed normally by DPP4.


Attached Files
.tif   Experiment.G21012.RT54.tif (Size: 493.93 KB / Downloads: 186)
Reply
#4
(02-16-2020, 09:12 PM)ajax Wrote:
(02-16-2020, 01:23 PM)Ofnuts Wrote: Which Gimp version? What settings? On my Gimp 2.10.14, with no compression, a 400x400 image with a single layer without alpha channel exports as a 664K file, and reloads in Gimp without getting an alpha-channel. Adding an alpha-channel makes it a 820K file.

Edit: this is confirmed by ImageMagick's identify that says:  tiff:alpha: unspecified for the image without alpha and tiff:alpha: unassociated for the image with alpha.

PS: Can you attach a (small) TIFF from an image without alpha channel in Gimp?

GIMP 2.10.12 is the newest I have.  However, this phenomenon has been going on for a long time that I've been using GIMP and certainly has existed in all of the 2.10.? versions I've used which is probably at least 5 different releases.

When exporting to tif I specify no compression, include all metadata, uncheck save layers and save thumbnail.

With GIMP I can create a small (400x400) image by copying such a selection from a real picture.  However, because I'm doing this with GIMP I have no way of opening such a file that was NOT created by GIMP.  I do notice when I create a new 400x400 image, with transparent background, GIMP says it has an alpha channel.  So I pasted the 400x400 selection copied from another image and then deleted the alpha channel.  When I export that as tif the result is a file that is 626.04KB according to XnViewMP.  Apparently that is too big to be attached here.  However, I can take that file and open it in Rawtherapee (5.4) and export it from there in tif format which produces a file that is 493.93KB which is attached.  If I then open that file in GIMP it indicates that there is no alpha channel.  However, if I now open the file created by GIMP in GIMP it says there is an alpha channel even though as stated above I purposely deleted the alpha channel before exporting.

Another factor is that of the 2 files referenced above the one created by GIMP cannot be opened by the software supplied with my cameras, Canon Digital Photo Profession R4 (DPP4), whereas the file created by Rawtherapee can be opened and processed normally by DPP4.

The file created with RT doesn't help. If the file is too big use a smaller image.
  • Created a 100x100 image (10000px) without an alpha channel. Filled with "Plasma".
  • Export as TIFF, no compression , all default settings, except skipped the thumbnail.
  • Exported TIFF is 30990 bytes (so roughly 3 bytes/pixel)
  • Layer>Transparency>Add alpha channel
  • Export as TIFF, no compression , all default settings, except skipped the thumbnail.
  • Exported TIFF is 41007 bytes (so roughly 4 bytes/pixel)
Do you get an alpha channel in Gimp if you open the Tiff-noAlpha one?


Attached Files
.tif   Tiff-noAlpha.tif (Size: 30.27 KB / Downloads: 187)
.tif   Tiff-Alpha.tif (Size: 40.05 KB / Downloads: 163)
Reply
#5
(02-17-2020, 08:04 AM)Ofnuts Wrote: ...

The file created with RT doesn't help. If the file is too big use a smaller image.
  • Created a 100x100 image (10000px) without an alpha channel. Filled with "Plasma".
  • Export as TIFF, no compression , all default settings, except skipped the thumbnail.
  • Exported TIFF is 30990 bytes (so roughly 3 bytes/pixel)
  • Layer>Transparency>Add alpha channel
  • Export as TIFF, no compression , all default settings, except skipped the thumbnail.
  • Exported TIFF is 41007 bytes (so roughly 4 bytes/pixel)
Do you get an alpha channel in Gimp if you open the Tiff-noAlpha one?

OK!  Working with your files I think I've discovered the cause as follows:
  • When I open Tiff-noAlpha.tif there is NO alpha channel.
  • When I export Tiff-noAlpha.tif without unchecking Save Layers there is NO alpha channel.
  • When I export Tiff-noAlpha.tif with Save Layers unchecked there is an alpha channel.
To be honest I can't explain why I don't want layers saved other than it sounds like something extra that I can't explain why I would want it.  In this case extra means extra size (storage space).  So it now looks like my intention of making the file smaller actually has the opposite affect of making it larger.

Looks like it would be good for me to learn the purpose of Save Layers.  Any suggestions?  How about reference documentation?

Thanks for your help!
Reply
#6
(02-17-2020, 01:44 PM)ajax Wrote: Looks like it would be good for me to learn the purpose of Save Layers.  Any suggestions?  How about reference documentation?

Thanks for your help!

It is used as a type of portable document format, often from a sheet feed scanner.
Think electronic document transmittals and fax machines.


   
Reply
#7
In my experiments Save Layers/No save layers made no difference, but of course I had a singe layer.
Reply
#8
(02-17-2020, 03:22 PM)Ofnuts Wrote: In my experiments Save Layers/No save layers made no difference, but of course I had a singe layer.

My results, using your Tiff-noAlpha single layer file, involved doing nothing different but check/uncheck Save Layers.  Are you saying that does NOT occur when you do it?

Also, I've now determined that leaving Save Layers checked seems to solve the problem of undesired alpha channel creation and associated increase in size (3 to 4 bytes per pixel) but NOT the incompatibility problem.  To make tif files created by GIMP recognizable by DPP4 I still need to recreate them using other software such as Rawtherapee.

From what I've recently noticed this Save Layer option was introduced in GIMP 2.10.12 which is too new for my previous assertion that this problem is one that I've dealt with for a long time.  I think that is explained by this finding which suggests that it is the lack of compatibility that I've been dealing with for a long time with the size problem being something that arrived with 2.10.12.  In my case the files in question are always single layer files.

While unchecking the Save Layers option now appears to have caused an alpha channel to have been added where none was intended, I'm still curious?  Why is that?

The compatibility problem appears no different now than back in 2018 when I made this post.
Reply
#9
A little more experimentation produced some results I found interesting.

Decided to see what happens when a multi-layer image is exported, in tif format, with Save Layers specified (up to now I've been unchecking this option).  Found the following:
  • Some other viewers/editors only display (?recognize) the bottom layer.  This particularly includes Rawtherapee.
  • Windows 10 Photo Viewer displays all layers but as separate pages.
  • When opened by GIMP all layers appear to be recreated accurately (although I've yet to try further editing on such a file).
  • File is still unrecognizable by Canon DPP4.
I've been saving my GIMP work in xcf files, which typically cannot be viewed by other software, and don't yet see any reason to save it in tif format.  At the same time I can see how this capability could be useful to others.  However, it also suggests that my intuitive rationale for unchecking the Save Layers option was quite valid and that for my purposes that should be the proper choice.
Reply
#10
(02-17-2020, 03:22 PM)Ofnuts Wrote: In my experiments Save Layers/No save layers made no difference, but of course I had a singe layer.

I've been running GIMP in portable fashion stored on thumb drives.  This allows moving up to new version without making any change to old version.  GIMP does use lots of storage but thumb drive makes that cheap.

Have now added GIMP 2.10.14 to said thumb drive.  It turns out that the issue that provoked this post (i.e., alpha channel mysteriously added by export) does NOT occur on 2.10.14 but does on 2.10.12 and in fact it appears as though Save Layer cannot be selected in the case when no layers have been added.  I haven't gone back to see what other earlier versions of GIMP may also have this defect.

Have now also learned a bit more about multi-layer editing in GIMP.  The things I've been doing did NOT seem to involve use of the alpha channel.  Therefore, this is something I did NOT pay much attention to.  However, it now does seem, to me, that alpha channel is something that goes along with many of the features that motivate use of multiple channels even if this is something for which I was unaware.  As a result, it now appears to me that producing the kind of tif file that I've been trying to create from a multi-layer image can be done by selecting Flatten Image from the Layer Dialogue.  Since I want the multiple layers retained, for future possible changes, in the xcf file it looks like I need to be real careful to avoid erroneously saving the flattened image.

Anyway this seems to solve both the storage consumption problem associated with unnecessary alpha channel as well as the compatibility issue that was forcing me to reprocess tif files created by GIMP with other software.

Many thanks to contributors who guided me toward these discoveries and please correct any apparent misunderstanding on my part.
Reply


Forum Jump: