flat assembler
Message board for the users of flat assembler.

Index > Main > two not quite same tga[solved]

Author
Thread Post new topic Reply to topic
vivik



Joined: 29 Oct 2016
Posts: 671
vivik 25 Aug 2017, 16:11
Any idea what's the difference between those two tga images? test.tga displays correctly in my image viewer, and t_c.tga is corrupted somehow. I got test.tga by opening and resaving t_c.tga with gimp.


Description:
Download
Filename: t_c.tga.txt
Filesize: 354.49 KB
Downloaded: 585 Time(s)

Description:
Download
Filename: test.tga.txt
Filesize: 356.49 KB
Downloaded: 580 Time(s)



Last edited by vivik on 27 Aug 2017, 09:24; edited 1 time in total
Post 25 Aug 2017, 16:11
View user's profile Send private message Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 671
vivik 26 Aug 2017, 05:19
I suspect that this is the cause:

https://en.wikipedia.org/wiki/Truevision_TGA#Specification_discrepancies

>The older version of the TGA file format specification
>"The packet may cross scan lines"
>TGA v2.0 specification states the exact opposite
>"Run-length Packets should never encode pixels from more than one scan line."

Not sure how to check it at the moment.
Post 26 Aug 2017, 05:19
View user's profile Send private message Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 671
vivik 26 Aug 2017, 12:03
found this in test.tga, offset 0x586f6

ff 00000000 d8 00000000 ff 00000000 ff 00000000

it's confirmed, gimp saves according to the newer specification.




The strange thing is, t_c.tga starts with many zeroes and ends with garbage, while for test.tga it's opposite. Did gimp also flipped the image or something?

Yeah, t_c.tga is flipped. Offset 0x11, bit 5 is set, image is flipped vertically.




Not sure if I should try to fix the image generator, or search for a different image viewer. Not sure why I even bother.
Post 26 Aug 2017, 12:03
View user's profile Send private message Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2595
Furs 26 Aug 2017, 12:57
Why even use tga? Isn't png superior compression-wise?
Post 26 Aug 2017, 12:57
View user's profile Send private message Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 671
vivik 26 Aug 2017, 13:02
png is slower to decompress, and also is more complex. Not sure if that matters.
Post 26 Aug 2017, 13:02
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.