Jump to content

TGA corner pixels have Red and Blue channels swapped after export

Recommended Posts

TLDR: When exporting to TGA(Targa) format UpperRight and LowerRight corners have their Red and Blue channels swapped.


Steps to reproduce:

1) Create any document.

2) Place in UpperRight or LowerRight corner object with color that has different Red and Blue channels. eg. R:125 G:00 B:00

3) Export image as TGA(Targa)

4) Load exported TGA image to AffinityDesigner.


Actual result:

One pixel in both right corners has Red and Blue components swapped. If we saved this color in one of corners: (R:125 G:00 B:00) the loaded pixel in that corner will be: (R:00 G:00 B:125)

Expected result: components are not swapped during export. Especialy useful if you are writing TGA loaders/converters and you are expecting that data you are loading is correct...


Additional info:

I have not experienced any problems with Green or Alpha chanel so it seems to be affecting only Red and Blue.'

Export size seems to not have affect it's always one pixel from both corners.

It's not loading problem. After checking TGA files with Hex editors and checking values stored inside the incorrect values are saved during export.


Files to reproduce and screenshots are attatched:

2 .afdesign files with sources that can be used to export check source files.

3 Exported TGA images where inproper behaviour can be spotted

3 Screenshots from symetric gradient presenting incorrect data after export.









Share this post

Link to post
Share on other sites

Hi Lorthiz,

Thanks for letting us know. I've reproduced this here and I believe there is a fault in both saving and loading the TGA. For example opening a TGA saved in Photoshop will display 1 inverted pixel as well! I will get it passed on to development.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

These are the Terms of Use you will be asked to agree to if you join the forum. | 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.