It is currently Mon Aug 17, 2026 6:35 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Color to Alpha
PostPosted: Fri Mar 21, 2014 4:13 pm  (#1) 
Offline
GimpChat Member

Joined: Mar 21, 2014
Posts: 5
Hello
I'm new around here and looking for some help. I'm trying to figure out how to take a folder and sub-folders with images of .tga files and just add color to alpha black to each image and then just save it. I have thousands of images to do and I can't do them one at a time.

This is what I do now.
open file *.tga
Layer/Transparency/Color to Alpha (black) press OK
File/Overwrite *tga

Any help is greatly appreciated.


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Color to Alpha
PostPosted: Fri Mar 21, 2014 4:35 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Use ImageMagick:

http://www.fmwconcepts.com/imagemagick/ ... ransparent

_________________
Image


Top
 Post subject: Re: Color to Alpha
PostPosted: Fri Mar 21, 2014 7:07 pm  (#3) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
What OS are you using?

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Color to Alpha
PostPosted: Fri Mar 21, 2014 7:37 pm  (#4) 
Offline
GimpChat Member

Joined: Mar 21, 2014
Posts: 5
Win 7 64bit


Top
 Post subject: Re: Color to Alpha
PostPosted: Fri Mar 21, 2014 7:45 pm  (#5) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Sorry, I will have to get back to you tomorrow. Something's come up that I need to deal with.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Color to Alpha
PostPosted: Sun Mar 23, 2014 1:42 pm  (#6) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
The following script will perform a color to alpha on all .tga files in the current directory and all of its subdirectories. All such files will be overwritten so working on a copy of the directory tree is advised.

http://chiselapp.com/user/saulgoode/rep ... 9aa874d798

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Color to Alpha
PostPosted: Tue Mar 25, 2014 3:39 pm  (#7) 
Offline
GimpChat Member

Joined: Mar 21, 2014
Posts: 5
Thank you for the help.

I have tried running the script and it looks like it is doing something but when I check the files nothing has changed. The files are not even overwritten so I'm not sure what is going on or what I am doing wrong.

I put the script into the scripts folder C:\Users\name\.gimp-2.8\scripts
Open gimp
Open Gimp / Filters / Misc / Process TGA Files...

Find the folder I need to process and press OK.

It looks like it is processing files but nothing seems to be happening when I go back and check the files after it finishes.

So I'm not sure what I am missing.

Thanks again for the help.


Top
 Post subject: Re: Color to Alpha
PostPosted: Tue Mar 25, 2014 5:20 pm  (#8) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
It is unclear to what extent transparency is supported in TGA files. It is apparently not part of the baseline specification but is added by some applications in a proprietary "chunk".

If you want me to modify the script to output PNG files instead, I will do so; but I am not interested in writing code to support any proprietary formats.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Color to Alpha
PostPosted: Tue Mar 25, 2014 11:39 pm  (#9) 
Offline
GimpChat Member

Joined: Mar 21, 2014
Posts: 5
If trying .png files is just changing tga to png I have tried that with the same results.

It looks like its running doing something but I have yet to figure out what it is doing because I have not found any files the script changes.


Top
 Post subject: Re: Color to Alpha
PostPosted: Wed Mar 26, 2014 12:19 am  (#10) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Oops, a silly mistake on my part. Try the following version.

http://chiselapp.com/user/saulgoode/rep ... 95d2768b51

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Color to Alpha
PostPosted: Wed Mar 26, 2014 3:06 pm  (#11) 
Offline
GimpChat Member

Joined: Mar 21, 2014
Posts: 5
That is perfect I thank you 1000x.


Top
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group