How to convert RGBA4444 TGA files to RGBA8888 ?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
pierro787
Posts: 5
Joined: 2017-03-06T05:42:59-07:00
Authentication code: 1151

How to convert RGBA4444 TGA files to RGBA8888 ?

Post by pierro787 »

Hi,

I have several thousands of tga files (without palette) wich contain RGBA4444 data (I know usualy tga files don't contain RGBA4444 datas). I would like to convert them into RGBA8888 data. I use the following command line

convert -depth 4 woody4.tga -depth 8 woddy8.tga

In this case, woody4.tga is the original rgba4444 file, and woody8 the target rgba8888 file but it doesn't change the colors of my pictures, what am I missing ?

Thanks,

Pierre
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to convert RGBA4444 TGA files to RGBA8888 ?

Post by snibgo »

Are you saying your image files are not in a standard TGA format? Then I doubt IM can successfully read them.

Perhaps some kind of mangling with IM at the command line is possible. Are the pixels compressed? If not, the simplest method may be a simple program (or bash script) that reads the bytes and expand them to IM's "RGB:" format.
snibgo's IM pages: im.snibgo.com
pierro787
Posts: 5
Joined: 2017-03-06T05:42:59-07:00
Authentication code: 1151

Re: How to convert RGBA4444 TGA files to RGBA8888 ?

Post by pierro787 »

Yes the data are not in a standard TGA format. Here are some of them:

http://www.maison-sartrouville.fr/voisin/

The pictures are from the game "Neigbours from hell". Some people wrote successfully a program to convert them with DarkBasic Pro from RGBA 4444 to RGBA 8888 but I'm asking if Imagemagick can not do the job successfully.

Thanks for your help,

Pierre
pierro787
Posts: 5
Joined: 2017-03-06T05:42:59-07:00
Authentication code: 1151

Re: How to convert RGBA4444 TGA files to RGBA8888 ?

Post by pierro787 »

The pixels are not compressed, there are simply 16 bits depth, no palette, nothing special except there are into the RGBA 4444 format.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to convert RGBA4444 TGA files to RGBA8888 ?

Post by fmw42 »

Need they be converted to TGA or any 8-bit per channel depth format?

What is your IM version and platform/OS? Please always provide that.
pierro787
Posts: 5
Joined: 2017-03-06T05:42:59-07:00
Authentication code: 1151

Re: How to convert RGBA4444 TGA files to RGBA8888 ?

Post by pierro787 »

any 8-bit per channel depth format wil be ok, BMP for example is OK

Thanks,
pierro787
Posts: 5
Joined: 2017-03-06T05:42:59-07:00
Authentication code: 1151

Re: How to convert RGBA4444 TGA files to RGBA8888 ?

Post by pierro787 »

My version is: ImageMagick 7.0.5-1 Q16 x64 2017-03-04 (Windows 10 64 bits)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to convert RGBA4444 TGA files to RGBA8888 ?

Post by fmw42 »

Does this do what you want?

Code: Select all

magick identify -verbose N_birthday_0000.tga
Channel depth:
red: 5-bit
green: 5-bit
blue: 5-bit
alpha: 1-bit

Code: Select all

magick N_birthday_0000.tga -depth 8 result.tga

Code: Select all

magick identify -verbose result.tga
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
alpha: 1-bit
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to convert RGBA4444 TGA files to RGBA8888 ?

Post by snibgo »

@pierro787: can you link to an example (eg .PNG) of what one of those images should look like? IM can read those TGA files, but I suppose it is misreading them, thinking they have 5 bits/channel/pixel when they really have only 4.
snibgo's IM pages: im.snibgo.com
Post Reply