Question 'bout alpha-channels...

Discussing the game, editor (Suite) and the related tools.
Post Reply
User avatar
Duke Falcon
First Lieutenant
First Lieutenant
Posts: 140
Joined: 2019-09-23 17:26, Monday
Location: Pegasus galaxy
Contact:

Question 'bout alpha-channels...

Post by Duke Falcon » 2023-01-23 15:30, Monday

Okay, I admit I often pestered by the alpha-channels thus thought I ask it:

Could be OG handle png files with alphas?
Not sure how hard to code it into the engine so this is a question so far...

I tried ImageMagick what Csaba recommended but my Win7 neglect to use it anyway (after install it the windows bombing me with nice blue screens whenever I try to use it, while uninstall get rid of those nice blue screens). I tried literally all versions for my Win7 with no avail... It is not a hardware trouble either because I use the same SSDs I used in the previous PC only the processor evolved from 2-core to 4-core...
Manually remove alpha from the file cause troubles after save the file (maybe hex editing needed for proper editing, dunno)...

I no longer use XP so old Paint what got rid of alpha-channels are history now. Trouble is that both current Paint and PS saves even BMP files with alpha-channel. So making new icons is a wee-bit troubled...

Any ideas or solutions? I myself ran of of ideas...

User avatar
randowe
Lieutenant Colonel
Lieutenant Colonel
Posts: 2895
Joined: 2019-09-20 19:02, Friday
Location: Germany

Re: Question 'bout alpha-channels...

Post by randowe » 2023-01-23 16:08, Monday

So you want to create png icons for Open General, correct?
I ask because you mention png and bmp.
Image Slava Ukraini!

User avatar
Duke Falcon
First Lieutenant
First Lieutenant
Posts: 140
Joined: 2019-09-23 17:26, Monday
Location: Pegasus galaxy
Contact:

Re: Question 'bout alpha-channels...

Post by Duke Falcon » 2023-01-23 20:08, Monday

randowe wrote:
2023-01-23 16:08, Monday
So you want to create png icons for Open General, correct?
I ask because you mention png and bmp.
Yepp.

So long my method were make the icon in PhotoShop, saved as BMP to revent alpha-channel (PS adds that but not sure really why...). Then load in Paint and saved as PNG because XP's Paint saved PNGs without alpha. Win7's (and over) Paint save even BMPs with alphas.
So alpha-channels everywhere what iz bad. Ima teh cofuzed 'cause thoooose...
I made tons of new icons for Modern Warfare conversion to OG just all new icons alpha-contaminated. A bad plague iz feelz like :(

Ja...

User avatar
randowe
Lieutenant Colonel
Lieutenant Colonel
Posts: 2895
Joined: 2019-09-20 19:02, Friday
Location: Germany

Re: Question 'bout alpha-channels...

Post by randowe » 2023-01-23 20:20, Monday

When i design OG icons and maps with photoshop, i choose "save for web" and then simply save them as png-8-bit. There is a checkbox for transparency, that is unchecked of course.
Image Slava Ukraini!

User avatar
Duke Falcon
First Lieutenant
First Lieutenant
Posts: 140
Joined: 2019-09-23 17:26, Monday
Location: Pegasus galaxy
Contact:

Re: Question 'bout alpha-channels...

Post by Duke Falcon » 2023-01-25 16:08, Wednesday

randowe wrote:
2023-01-23 20:20, Monday
When i design OG icons and maps with photoshop, i choose "save for web" and then simply save them as png-8-bit. There is a checkbox for transparency, that is unchecked of course.
It means if I remember correctly that your icons are all indexed (use a custom palette of 256 colours but not more). That may work for some of my projects but MW use icons with blendig camoflague, often fade one colour into another. On older monitors\displays indexed versions of them may not an issue but on newer ones the limited palette would be well recognisable.
Those need 16 or 24 bit PNGs but those by PhotoShop standard contain alpha-channel. Not sure if there is a way to remove them during the saving process, I not figured out how-to myself.

It would be easier if OG could handle alpha-channel. Sure would be.
But I not know the source code of the exe thus cannot tell how many work or how hard would it be to implement that. Not to mention the case if such modification may not compatible with some other already-included features...
It is of Luis' territory to answer, consider or reject it. He codes the whole game, he knows it deep to it's bottom. We, meager minions just use it for our own tweaked-n-twisted ends :)

User avatar
LuisGuzman
General, Special Forces
General, Special Forces
Posts: 639
Joined: 2019-03-10 08:35, Sunday
Location: Spain
Contact:

Re: Question 'bout alpha-channels...

Post by LuisGuzman » 2023-01-26 07:28, Thursday

Duke Falcon wrote:
2023-01-25 16:08, Wednesday
randowe wrote:
2023-01-23 20:20, Monday
When i design OG icons and maps with photoshop, i choose "save for web" and then simply save them as png-8-bit. There is a checkbox for transparency, that is unchecked of course.
It means if I remember correctly that your icons are all indexed (use a custom palette of 256 colours but not more). That may work for some of my projects but MW use icons with blendig camoflague, often fade one colour into another. On older monitors\displays indexed versions of them may not an issue but on newer ones the limited palette would be well recognisable.
Those need 16 or 24 bit PNGs but those by PhotoShop standard contain alpha-channel. Not sure if there is a way to remove them during the saving process, I not figured out how-to myself.
As far as I know 24 bit PNG doesn't include alpha channel as alpha channel requieres 4 bits per pixel, so there is no byte for alpha channel. :huh
It would be easier if OG could handle alpha-channel. Sure would be.
But I not know the source code of the exe thus cannot tell how many work or how hard would it be to implement that. Not to mention the case if such modification may not compatible with some other already-included features...
I'll re-check if I can do something to convert 32 bits/pixel to 24 bits/pixel when loading images in a way I don't need to throw out all graphic system.
We, meager minions just use it for our own tweaked-n-twisted ends :)
:belly :rofl
  Visit my website to get my latest tools.
* Click Open General banner to get more info about the game
Image

sympatyk
Major
Major
Posts: 556
Joined: 2019-10-03 17:05, Thursday

Re: Question 'bout alpha-channels...

Post by sympatyk » 2023-01-26 13:35, Thursday

I don't have Photoshop - that's why I didn't participate in the discussion, but the topic interests me ..

A little test
I drew in gimp with a red brush...
Saved to png - with transparency (alpha channel) --> png1 and without alpha channel --> png2
Everything in 32-bit space --> in png images reduced to 24-bit

image in gimp
Image

png1 image with alpha

Image

image png1 - original

Image

png2 image (without alpha) - original

Image

sympatyk
Major
Major
Posts: 556
Joined: 2019-10-03 17:05, Thursday

Re: Question 'bout alpha-channels...

Post by sympatyk » 2023-01-27 16:15, Friday

I had fun - a little more
I created a drawing and saved it as 3.png with alpha channel
Image

Then I loaded png3.png into IrvanView and re-saved as 33.png without alpha channel

Image

IrvanView gives you the ability to save a .png file
- no transparency (no alpha channel)
- with transparency (alpha channel)
- with a selected color from the drawing - which will represent transparency

Image

Note that if you use non-transparency save and your drawing has transparent pixels --> then black color will appear in this place (transparent pixels will become black)

I recommend the program - choose the 32 or 64 bit version
You can also download your own language and add-ons for more possibilities
https://www.irfanview.com/main_download_engl.htm
edit
IrfanView supports batch processing - you can do it for multiple icons at once

User avatar
Duke Falcon
First Lieutenant
First Lieutenant
Posts: 140
Joined: 2019-09-23 17:26, Monday
Location: Pegasus galaxy
Contact:

Re: Question 'bout alpha-channels...

Post by Duke Falcon » 2023-01-30 20:21, Monday

I'll re-check if I can do something to convert 32 bits/pixel to 24 bits/pixel when loading images in a way I don't need to throw out all graphic system.
Thanks!

+I try this IrfanView what sympayk suggested. Try to get rid alphas with it so long.

User avatar
Duke Falcon
First Lieutenant
First Lieutenant
Posts: 140
Joined: 2019-09-23 17:26, Monday
Location: Pegasus galaxy
Contact:

Re: Question 'bout alpha-channels...

Post by Duke Falcon » 2023-02-08 21:15, Wednesday

Quick question:
Is there an easy way to check which icons have alpha-infestation? Or could we have some sign in Suite for that?
IrfanView clears alpha nicely from those icons I knew contained it. Not sure how many still has because I converted only three campaigns from PeG so far and those nations now checked (fixing british now). But equipment just have so much more nations :S

sympatyk
Major
Major
Posts: 556
Joined: 2019-10-03 17:05, Thursday

Re: Question 'bout alpha-channels...

Post by sympatyk » 2023-02-08 23:44, Wednesday

:howdy
Instead of manually finding which icons have an alpha channel - you can subject all of them to an automatic process - removing the alpha channel (whether it is or not) --> you can use batch processing

You open IrfanView
You press the "B" key on your keyboard

Image

Select directory - source (icons to be processed)
Click the appropriate button --> add all
Select the output format - PNG
Set options (to get rid of alpha)
Select destination directory (non-alpha icons)

Image

Then advanced options --> color depth change (set what you need)
I still use --> Use best color quality
Don't forget to confirm - OK
Press the start button - wait for the process to complete. Now it all depends on your CPU and how many icons will be processed... 200 or 3000...

User avatar
LuisGuzman
General, Special Forces
General, Special Forces
Posts: 639
Joined: 2019-03-10 08:35, Sunday
Location: Spain
Contact:

Re: Question 'bout alpha-channels...

Post by LuisGuzman » 2023-02-09 07:31, Thursday

Thank you so much Grzegorz, splendid explication & hints
:clap
  Visit my website to get my latest tools.
* Click Open General banner to get more info about the game
Image

User avatar
Duke Falcon
First Lieutenant
First Lieutenant
Posts: 140
Joined: 2019-09-23 17:26, Monday
Location: Pegasus galaxy
Contact:

Re: Question 'bout alpha-channels...

Post by Duke Falcon » 2023-02-09 15:30, Thursday

sympatyk wrote:
2023-02-08 23:44, Wednesday
:howdy
Instead of manually finding which icons have an alpha channel - you can subject all of them to an automatic process - removing the alpha channel (whether it is or not) --> you can use batch processing

You open IrfanView
You press the "B" key on your keyboard

Select directory - source (icons to be processed)
Click the appropriate button --> add all
Select the output format - PNG
Set options (to get rid of alpha)
Select destination directory (non-alpha icons)

Then advanced options --> color depth change (set what you need)
I still use --> Use best color quality
Don't forget to confirm - OK
Press the start button - wait for the process to complete. Now it all depends on your CPU and how many icons will be processed... 200 or 3000...
Marvellous! Thanks a hundreds of times! It worked like a charm!
I also saved this post of yours for later use. No more alpha-infestation I say!
:yes

Post Reply