Post Reply 

Script fu and Color to alpha

Aug 19, 2014, 07:47
Post: #1
Script fu and Color to alpha
Hi All

I have been searching, but haven´t found what I am searching for yet, but I am sure that some of you know exactly how to do this.

I often have a lot of pictures taken in a studio, there I want to remove the background to alpha on each picture.
I found the "Color to Alpha" function in Gimp which fits perfect for me.
I want to do this for a lot of pictures once in a while, so I want to create a Script Fu - script to handle this.
Can some one help me with, creating following in script fu:
- looping all files in a folder
- Run "Color to alpha" function on each photo, with an input color, fx #FFFFFF
- Save each photo to another folder

Im running the windows version, if that change anything...
I hope some one can help me with this, it will save me a lot of time, not to do this on each photo.

Best regards
John
Find all posts by this user
Quote this message in a reply
Aug 19, 2014, 09:16 (This post was last modified: Aug 19, 2014 09:25 by rich2005.)
Post: #2
RE: Script fu and Color to alpha
If you do not want to wait for a hand-crafted script there is BIMP batch plugin.

http://www.alessandrofrancesconi.it/projects/bimp/

all-in-one screenshot looks like this

[Image: 4QTLEAL.jpg]

Add files or folders
Add the procedures you need
Since it it color-to-alpha, first change the format to png (or maybe tif)
Add 'Other Gimp Procedure' find plug-in-colortoalpha Default is black, so change to white.
Select the output folder
Apply the procedure.

It is possible to save your set of procedure to a bimp file for re-use.

What it will not do,
Apply the same procedure twice. If you want the output other than png then another separate run of BIMP is required.
Not all image formats are supported, psd for example.

screen shot http://i.imgur.com/FPaJpCe.jpg original files / processed files.

Another ready-made alternative is Imagemagick and command line, can be as easy as
Code:
convert input.png -transparent white output.png
but would need a batch wrapper for windoze.

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
Aug 19, 2014, 12:01
Post: #3
RE: Script fu and Color to alpha
Hi

Thanks a lot for a quick reply, I will try both tonight!!

Best regards
John

(Aug 19, 2014 09:16)rich2005 Wrote:  If you do not want to wait for a hand-crafted script there is BIMP batch plugin.

http://www.alessandrofrancesconi.it/projects/bimp/

all-in-one screenshot looks like this

[Image: 4QTLEAL.jpg]

Add files or folders
Add the procedures you need
Since it it color-to-alpha, first change the format to png (or maybe tif)
Add 'Other Gimp Procedure' find plug-in-colortoalpha Default is black, so change to white.
Select the output folder
Apply the procedure.

It is possible to save your set of procedure to a bimp file for re-use.

What it will not do,
Apply the same procedure twice. If you want the output other than png then another separate run of BIMP is required.
Not all image formats are supported, psd for example.

screen shot http://i.imgur.com/FPaJpCe.jpg original files / processed files.

Another ready-made alternative is Imagemagick and command line, can be as easy as
Code:
convert input.png -transparent white output.png
but would need a batch wrapper for windoze.
Find all posts by this user
Quote this message in a reply
Sep 19, 2014, 20:32
Post: #4
RE: Script fu and Color to alpha
What it will not do,
Apply the same procedure twice. If you want the output other than png then another separate run of BIMP is required.
Not all image formats are supported, psd for example.

Mohsin
Find all posts by this user
Quote this message in a reply
Sep 20, 2014, 08:46
Post: #5
RE: Script fu and Color to alpha
Quote:What it will not do, Apply the same procedure twice.

That is true, what it will do is process & overwrite the original files (never a good idea) then you can apply Bimp a second time.

Quote:If you want the output other than png then another separate run of BIMP is required.
I am guessing this is linked to the first comment, and the need to output the same file in multiple formats.
If a re-run is so arduous, then look at something else, ImageMagick maybe.

Quote:Not all image formats are supported, psd for example.
This is very true but why support the evil Ad*be Wink
What is supported: bmp, jpg, gif, png, svg, tiff xcf and similar for changing format to: bmp, gif, ico, jpeg, tga, tiff
Again for a wider range of formats I would go for Imagemagick.

But on the whole, BIMP is a useful tool for run-of-the-mill batch work.

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Request for script chlebna 1 197 Sep 13, 2017 09:35
Last Post: ythgilb
  Request for script - Guillotine + Watermark sunslick 1 255 Sep 4, 2017 08:51
Last Post: ythgilb
  Script-fu: How to create new, addressable layer using gimp-floating-sel-to-layer Bertholomäus 1 278 Aug 31, 2017 14:32
Last Post: Bertholomäus
  How to modify this script-fu? Zakary81 1 222 Aug 23, 2017 12:48
Last Post: paynekj
  Need help in running a gui script-fu via command line eyalzek 2 380 Oct 4, 2014 14:05
Last Post: eyalzek

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS