0

I am using a program that requires a .tiff input with 8 bits (grayscale) and the 1 sample per pixel characteristic. I scale the layer down in GIMP, keep the canvas the same size, choose grayscale, and turn off the alpha channel. Only 1 layer exists. However, when I export the image, the size is twice the original image, has two samples per pixel, and says that there is an alpha channel. The following is output from the sips command on OS X.

pixelWidth: 3296
pixelHeight: 2472
typeIdentifier: public.tiff
format: tiff
formatOptions: default
dpiWidth: 72.000
dpiHeight: 72.000
samplesPerPixel: 2
bitsPerSample: 8
hasAlpha: yes
space: Gray

My main guess is the alpha channel is saving when the layer is smaller than the canvas, even though the alpha channel is turned off for the layer. Any ideas why this is happening? Appreciate any answers.

3
  • What is a "sample" in this case? Do you mean bits?
    – Rafael
    Jan 18, 2017 at 21:41
  • I am not sure, but the bitsPerSample is 8, which is what I need it to be
    – SPV
    Jan 18, 2017 at 21:45
  • Oh. I see. This is wierd, because yes, a grayscale image should be 1 sample (channel). And yes, it looks that the empty alpha is counting as an aditional channel, which in reality is.
    – Rafael
    Jan 18, 2017 at 22:01

2 Answers 2

0

Works for me if I use grayscale mode. Saved with no compression:

identify 100x100-grayscale.tif 
100x100-grayscale.tif TIFF 100x100 100x100+0+0 8-bit Grayscale DirectClass 10.3KB 0.000u 0:00.000

The 10K size is coherent with a single byte per pixel.

3
  • I should have clarified. I am looking for 8 bits, but 1 sample
    – SPV
    Jan 19, 2017 at 15:12
  • @SPV OK, used grayscale and still no extra alpha channel. Did you really remove the alpha channel (layer name is boldface when there is none)?
    – xenoid
    Jan 19, 2017 at 15:55
  • could you try scaling the layer to a smaller size but keeping the canvas size the same?
    – SPV
    Jan 19, 2017 at 16:07
0

ANSWER:

When a .tiff image is scaled down and canvas is exposed, the 'file > export' command will produce a .tiff image where the empty canvas space is saved as transparent pixels. (thank you to @xenoid for helping me discover this issue)

Therefore, the empty space needs to be filled. Choose 'Layer > New Layer' from Visible and use the bucket to fill the empty areas with whatever color works. Then merge the layers using 'Image > Merge Visible Layers'.

Lastly, select the merged layer in the layers panel and select 'Remove alpha channel'.

The image can then be exported as a true grayscale image without the additional alpha channel value per pixel.

1
  • seems to me that simply cropping the canvas would also solve your issue. Anyway, accepting your own answer is allowed on this site...
    – Yorik
    Jan 19, 2017 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.