Jump to content
You must now use your email address to sign in [click for more info] ×

Recommended Posts

When processing a 114 mb 16 bit tif file, in Affinity Photo, after various adjustment layers are made and then flattened, the file is exported as an 8 bit tif file with the size of 57 mb as you would expect. However when the crop tool is used to reposition the image to cut the bottom part of the image and leave a blank area at the top of the image for later filling in using the clone tool, the size of the exported 8 bit tif is  76.2 mb. The dimensions of the image is correct, just the file size is 'wrong'. The crop parameters are exactly the same dimensions as the original.

Before exporting I have added other adjustment layers and then flattened the image, but whether I do this or not, the output size is still 76.2 mb. If I open this exported 8 bit file in Photoshop it shows as 'Layer 0' and if I then flatten it in Photoshop it then saves as a 57 mb file. The only conclusion I can draw from this is that Affinity Photo is creating an invisible layer when the crop tool is used in this way and this layer cannot be flattened within Affinity itself. I have used this technique now on a few images, each with different amounts of crop used and the output file is always the same - 76.2 mb.

Link to comment
Share on other sites

To try and get a smaller file I have used an old 16 bit file which is only 47mb in size, which I attach. When I export this in Affinity as an 8 bit file this becomes a 23.4mb, which is correct. When I use the crop tool as described and then export it as an 8 bit file it's size is 31.2 mb which is incorrect.

 

I am attaching both the 16 bit input file and the 8 bit problem file as requested....

8_Bit_problem.tiff

16_Bit_Image.TIF

Link to comment
Share on other sites

No - This is always unticked. Just noticed that this problem occurs however small the amount of space outside the image is. I just cropped an image to straighten it and I noticed I left just a tiny space in one corner that was outside the original image. I cloned this space out, but when save the image was 76.2 mb instead of 57 mb.

I'm sure you can very easily duplicate this with any 16 bit image.

Also - I have tried Document / Flatten, even though no layers are shown in Affinity Photo, but this makes no difference.

Link to comment
Share on other sites

Not sure how to do this. I am sending the same file where the file size is correct where I haven't cropped.......

I'm sure there must be a hidden layer in the larger file - one that Affinty creates when cropping outside the image boundary, but a layer that doesn't show up in Affinity itself, although it does show up as Layer 0 when the 8 bit image is viewed in Photoshop.

My workflow for the problem image I sent you is very straightforward as follows:

Open 16 bit image

Using the crop tool at the absolute size I move the crop tool up to crop out the bottom part of the image and create empty space at the top of the image.

Using the clone tool I then copy some of the image content into the empty space at the top.

I then export the image as an 8 bit tiff.

 

 

8_Bit_Image_normal.tiff

Link to comment
Share on other sites

No - the file I've just attached is the 8 bit output file that is correct. The file I sent you before is the one that has the layer called 8 bit problem tif.

Both these files are from the same 16 bit input tif (which I also sent you). The problem file is when I've used the crop tool as describes, the most recent one is when I have not done this. The difference in size between these 2 files is 7.8 mb.

Link to comment
Share on other sites

  • Staff

The "problem" is the alpha channel. Because you choose "uncompressed", the alpha channel will take the exact same space on disk as any of the other 3 channels. So, if any of your pixels are transparent(full or partial), you will have an alpha channel exported with your TIFF To prove this, drag a rectangle over the transparent area and export. The file size will be "correct". Nothing wrong with the file/workflow. :)

Link to comment
Share on other sites

Not sure I understand the alpha channel, but from what you are saying this only exists when there are transparent pixels?

If that is the case, when I fill in all those pixels should this not disappear?

Is the alpha channel exported with the tiff something different to a layer? Photoshop appears to treat this as a layer as it appears as a 'Layer 0' and can be flattened. Canon's DPP 4 software also cannot read this larger tif with embedded alpa channel.  I could use photoshop to overcome what to me is a 'problem', but I am trying to replace photoshop with affinity photo.....

Is there no way of flattening this alpha channel to make the 8 bit file the 'correct' file size (ie half the 16 bit file size).

 

Link to comment
Share on other sites

  • Staff

Yes. That layer only exists when you have transparent/semi-transparent pixels. It's nothing wrong with it. This is the expected behaviour. You have an extra channel, in addition to your Red, Green and Blue channels to hold the transparency data. Saving it as uncompressed, it will use 1 byte per pixel. You have an 8mp image, so that should 8mb increase is right. Is there any reason why you choose uncompressed TIFF? Both ZIP and LZW are lossless compression methods so there is no real advantage in saving uncompressed unless you want large files :)

7 minutes ago, BC15 said:

Photoshop appears to treat this as a layer as it appears as a 'Layer 0' and can be flattened

Would you expect to treat it differently? There is only one layer so I don't see anything wrong. 

8 minutes ago, BC15 said:

Canon's DPP 4 software also cannot read this larger tif with embedded alpa channel.

Perhaps they don't support uncompressed tiff files with alpha channels. I suggest you check this with them. 

9 minutes ago, BC15 said:

Is there no way of flattening this alpha channel to make the 8 bit file the 'correct' file size (ie half the 16 bit file size).

Alpha channel is not a layer, so there is nothing to flatten. You can create a solid rectangle and place it below the image in the layer stack. This way any transparent pixels will become the colour of that rectangle - if you don't see any it's perhaps very low transparency and you will not see any difference by having a rectangle below the image. 

Link to comment
Share on other sites

5 minutes ago, GabrielM said:

Yes. That layer only exists when you have transparent/semi-transparent pixels. It's nothing wrong with it. This is the expected behaviour. You have an extra channel, in addition to your Red, Green and Blue channels to hold the transparency data.

Sorry I don't understand - If it only exists when I have transparent pixels, how come it is included in the tif when I have replaced all of those transparent pixels by pixels cloned from the rest of the image?

5 minutes ago, GabrielM said:

Would you expect to treat it differently? There is only one layer so I don't see anything wrong. 

What I was trying to point out is that is that photoshop enables you to 'flatten' the image which appears to remove the Alpha 'layer' as the size reverts to the 'normal' size.

 

I am not trying to pick holes in Affinty Photo. I am trying to work with it as a replacement to Photoshop. I tried asking questions about what to me was an issue on the forum, but I didn't get any responses that explained what was happening. I had initally thought I was probably doing something wrong. When this didn't get me anywhere I decided that my only course of action was to report it as a 'bug'. It is an issue to me and I am simply looking for a solution where the alpha 'layer' or whatever it is can be 'flattened' as it can be in photoshop, to revert the file to a 'normal' tif with a 'normal' size.

Link to comment
Share on other sites

12 hours ago, BC15 said:

Is the alpha channel exported with the tiff something different to a layer?

The alpha channel is something different from a layer.

Briefly (& a bit over-simplistically), in an RGB color model, each image pixel has 3 color channels, one each for the red, green, & blue component of the pixel's color, but each pixel can also have a transparency component, which is stored in an alpha channel. This is sometimes called "alpha transparency" & the color model is sometimes called "RGBA" for the four channels it includes.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

  • Staff

If the image is still "big", it still has transparency - 0.1% or 100%, it does not matter in your case as you're exporting uncompressed... . Is there any reason behind this? 

17 hours ago, BC15 said:

It is an issue to me and I am simply looking for a solution where the alpha 'layer' or whatever it is can be 'flattened' as it can be in photoshop, to revert the file to a 'normal' tif with a 'normal' size.

I've already given you a workaround. Place a rectangle below your image. That way you won't have any transparent pixels. 

Alternatively, you can go to the Channels tab, Right-click on the "layername" Alpha channel and choose "Fill". That will fill all the fully transparent pixels with black and any semi-transparent pixels with their full-opaque equivalent. 

Link to comment
Share on other sites

Going to the channels tab and using Fill as you suggested does work, even though no pixels are actually filled in as they are already 'filled' with cloned material from the rest of the image and no black pixels from the fill are present. Gives me the result I want though................

Link to comment
Share on other sites

18 minutes ago, BC15 said:

Going to the channels tab and using Fill as you suggested does work, even though no pixels are actually filled in as they are already 'filled' with cloned material from the rest of the image and no black pixels from the fill are present.

As @GabrielM mentioned earlier, if any of your pixels are even partially transparent, you will get an alpha channel on export. Judging from your 8_Bit_problem.tiff file, you probably used a soft Clone brush to fill in the top center of the image & did not extend it all the way to the left & right edges of the document -- note the soft, blurry looking areas to the right & left of center.

Regardless, that blurriness is a strong indicator that you did not completely fill the document with 100% opaque pixels. That is why you have to use a workaround.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

 

9 minutes ago, R C-R said:

As @GabrielM mentioned earlier, if any of your pixels are even partially transparent, you will get an alpha channel on export. Judging from your 8_Bit_problem.tiff file, you probably used a soft Clone brush to fill in the top center of the image & did not extend it all the way to the left & right edges of the document -- note the soft, blurry looking areas to the right & left of center.

Regardless, that blurriness is a strong indicator that you did not completely fill the document with 100% opaque pixels. That is why you have to use a workaround. 

The examples I sent were just roughly done - I didn't realise the importance of any transparent pixels at this time. To double check, I took a picture of a bright grey sky and did the crop  revealing the transparent pixels at the top. I cropped just a little in from both edges to make sure there were no transparent pixels at the horizontal edges. I then carefully cloned the transparent area with pixels from the rest of the image. I then filled the alpha channel and viewed the almost white image at 100%. No black pixels appeared and they would have easily shown up against the white pixels that the image consisted of.

Link to comment
Share on other sites

  • Staff

24 minutes ago, BC15 said:

No black pixels appeared and they would have easily shown up against the white pixels that the image consisted of.

Black pixels will only appear if the transparency of that pixel is 100%. Any lower values will be replaced with the opaque value of that pixel, so you will most likely see no difference. 

Screenshot 2019-08-16 at 11.08.30.jpgScreenshot 2019-08-16 at 11.08.07.jpg

Link to comment
Share on other sites

10 minutes ago, BC15 said:

Fair enough - the important thing is that the fill works and gives me what I need with very little additional effort required...... 'Problem' solved!

I think the question is still on the table of why you want uncompressed TIFF files. Allowing them to compress also avoids the problem, and does so more easily than having to manipulate the alpha channel contents.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

I don't see any benefit of compressing tif files apart from them taking up less space and storage is so cheap nowadays that this is not an issue, even for a largeish image library like mine. I'm not sure (because I don't know!) that compressing the tif would remove the alpha channel anyway and it's this that is the issue, rather than the size. Storing full size tifs is just a personal choice and I'm happy with this as my philosophy is the least processing on an image the better. The issue here is not actually the size of the tif, it is the fact that there is an extra channel within it which other software (like photoshop) treats as a layer even if it's not! The size was just something I noticed when Canon's DPP 4 (which I have to use to copy the Affinity Photo 8 bits to new 8 bits to recreate the missing EXIF thumnbail) failed to recognise the Affinity tif with the extra channel. If this hadn't happened I probably would not have noticed it. Compatability with other software is crucial. Most of my agents use jpegs and because of the missing EXIF thumbnail I also have to batch process the 8 bit files in DPP 4 to create them and as this doesn't recognise the tifs with embedded alpa channel this wouldn't work either and this is something I do on a regular basis (I don't save jpegs in my library, just generate them from the 8 bit tifs when required).

Link to comment
Share on other sites

Thanks.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.