It is currently Sat Jul 13, 2024 9:25 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Bulk removing alpha channel from over 1000 bmp imgs
PostPosted: Thu Jun 29, 2017 9:46 pm  (#1) 
Offline
New Member

Joined: Jun 29, 2017
Posts: 2
GIMP Version: 2.8.14
Operating System: Windows
GIMP Experience: New User

List any relevant plug-ins or scripts:
Batch Image Manipulation



Hi :)

So, title says it all, basically, I need to do Layer->Transparency->Remove Alpha Channel from bmps for over thousand times and I was wondering if there is anyway it could be done faster?

I'm desperate, I searched for it in the internet like mad, I even tried writing a script (which, I completely don't know how to do) and I'm at loss. Changing to format not supporting transparency and back again doesn't help. Nothing helps but this one option. I mean, I could index the colours to 255/256, but it really worsens the quality of the image, and the "Remove Alpha Channel" leaves the quality untouched, while the bitrate from 32 to 24. Please, please help me, please :)

And thank You in advance :)


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: Bulk removing alpha channel from over 1000 bmp imgs
PostPosted: Fri Jun 30, 2017 2:09 am  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4757
To process images in bulk, the best tool is ImageMagick, and even though there is no "color to alpha" operator, it can be done:

https://stackoverflow.com/questions/264 ... e-the-gimp

_________________
Image


Top
 Post subject: Re: Bulk removing alpha channel from over 1000 bmp imgs
PostPosted: Fri Jun 30, 2017 4:16 am  (#3) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2440
@Sei

Want something with a GUI - try XnConvert - http://www.xnview.com/en/xnconvert/

All you need is add one action change color depth and set 24 bits as the depth.

example http://imgur.com/swqLN9J

_________________
Image


Top
 Post subject: Re: Bulk removing alpha channel from over 1000 bmp imgs
PostPosted: Fri Jun 30, 2017 5:35 am  (#4) 
Offline
New Member

Joined: Jun 29, 2017
Posts: 2
A big Thank You to you both for such a quick response. :D

While I'm sure ofnut's idea would work alright if done properly, I used XnConvert and it works :D Quality stayed the same, but it (finally!) changed to 24bit.
Thank You sooo much :)


Top
 Post subject: Re: Bulk removing alpha channel from over 1000 bmp imgs
PostPosted: Sat Jul 01, 2017 3:28 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Apr 15, 2017
Posts: 1826
Alpha channel should be 32-bit, not 24.
8 for red, 8 for green, 8 blue and 8 for alpha.


Top
 Post subject: Re: Bulk removing alpha channel from over 1000 bmp imgs
PostPosted: Sat Jul 01, 2017 4:22 am  (#6) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2440
racer-x wrote:
Alpha channel should be 32-bit, not 24.
8 for red, 8 for green, 8 blue and 8 for alpha.


True, but read the first post/subject title again ;)

Quote:
...Remove Alpha Channel from bmps for over thousand times...

_________________
Image


Top
 Post subject: Re: Bulk removing alpha channel from over 1000 bmp imgs
PostPosted: Sat Jul 01, 2017 4:10 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Apr 15, 2017
Posts: 1826
I read it, but don't understand the logic behind it.....

Anyway ffmpeg can do it in a batch mode to convert all 32-bit bmp images in a folder into 24-bit png images or whatever. Assuming the OP uses Windows, this batch script should work:

SET PATH="C:\Path\To\FFMpeg"
for %%a in ("*.bmp") do ffmpeg -i "%%a" -pix_fmt rgb24 "%%~na.png"

pause


Top
 Post subject: Re: Bulk removing alpha channel from over 1000 bmp imgs
PostPosted: Sun Jul 02, 2017 3:35 am  (#8) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2440
Quote:
I read it, but don't understand the logic behind it.....


What is that saying, which starts Ours is not to reason why...

Quote:
Anyway ffmpeg can do it in a batch mode to convert all 32-bit bmp images in a folder into 24-bit png images or whatever. Assuming the OP uses Windows, this batch script should work:


Well the OP says he uses Windows and certainly you could do that with ffmpeg, but why? Ofnuts gave the best option with ImageMagick which could be as simple as:

mogrify -depth 24 -type truecolor *.bmp


Which will convert a whole directory full of .bmp images in place. Dangerous command is mogrify

Not everyone, especially Windows users are comfortable with using a terminal, hence a GUI option. I would have suggested BIMP as a Gimp plugin but the BIMP .bmp export function has no colour depth options.

edit: Not quite true, it is possible with BIMP, I forgot the obvious, flatten the image, not something I normally do ;) bad practice. That comes under Other Gimp Procedure = gimp-image-flatten then use the BIMP Change Format and select bmp. Nicely keeps semi-transparent pixels as shaded colour. Of course it is not 24 bit, still has an alpha channel but no transparent area.

_________________
Image


Top
 Post subject: Re: Bulk removing alpha channel from over 1000 bmp imgs
PostPosted: Sun Jul 02, 2017 11:04 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Apr 15, 2017
Posts: 1826
Quote:
you could do that with ffmpeg, but why? Ofnuts gave the best option with ImageMagick


I'm not familiar with ImageMagic commands and never used it. I am familiar with ffmpeg and use it often. There is very little ffmpeg can't do and it does it all very well. It is my go-to program for batch converting and much more. Anyway, it's just another option.


Top
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Alpha Channel not working

7

No new posts Attachment(s) Add Alpha Channel to All Layers

1

No new posts Eraser painting on layer that has alpha channel

2

No new posts Attachment(s) Colorizing (only) with a Radial Gradient/ Alpha Channel

8

No new posts Attachment(s) How does it works on Layer Blending Mode "Add" with Alpha Channel?

4



* Login  



Powered by phpBB3 © phpBB Group