Force partly transparent pixels to solid colour

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
User avatar
MartinHowe
Posts: 2056
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

Force partly transparent pixels to solid colour

Post by MartinHowe »

I am rotating images for actor sprites and want the output to have no partly transparent pixels. Essentially it should be like the simple image editors of old where the nearest colour in the actual image around the area in question was used; all the modern tools, even GIMP and ImageMagick create partially transparent pixels around the edge where there were none before; if I convert to RGB from RGBA and put in a solid background, it mixes the two colours.

Is there any graphics tool to which I can say "the transparent area in the source image is a MASK; do NOT treat it as actual pixels", or if I fill a solid colour in RGB mode first, tell the tool the same thing?

Please can anyone help?
Gez
 
 
Posts: 17937
Joined: Fri Jul 06, 2007 3:22 pm

Re: Force partly transparent pixels to solid colour

Post by Gez »

Have you tried Aseprite?

Or skewing three times, perhaps.
User avatar
MartinHowe
Posts: 2056
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

Re: Force partly transparent pixels to solid colour

Post by MartinHowe »

Gez wrote: Mon Jul 01, 2024 7:46 am Have you tried Aseprite?

Or skewing three times, perhaps.
Thanks very much Gez :D

Lucky I'm a tech guy as compiling aseprite is hard work, requiring installation of tons of stuff I would never otherwise use, and creating a build script,but it works; the Transform menu allows freehand rotating and crucially, shows you how much you are rotating it when you need a specific amount, and, doesn't leave partly transparent pixels. Kudos to them for their INSTALL readme file; it's well written, wish they were all like that.

I did have a look at the video about skewing, but that's an over the top learning curve just to rotate a sprite :shock:

EDIT: There is a way in GIMP, albeit somewhat clumsy; select the transparent bits (the ones you don't want), invert selection, then rotate; if there's a way to tell GIMP that the non-opaque parts should be used as a selection mask, I haven't found it yet.
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Force partly transparent pixels to solid colour

Post by ramon.dexter »

Compiling aseprite? Did you know you can buy it?
User avatar
MartinHowe
Posts: 2056
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

Re: Force partly transparent pixels to solid colour

Post by MartinHowe »

ramon.dexter wrote: Tue Jul 02, 2024 11:23 pm Compiling aseprite? Did you know you can buy pay money for it?
You just answered your own (slightly restated) question :p I resent paying for software that used to be free. That's why on Windows machines with HDD I still use version 7.14 of UltraDefgrag. That's why I still resent iD's choice of Final Doom (especially as they weren't written by iD). I will never charge for any DooM mods I made, ask for donations for them, Patreon, or anything like that.
Professor Hastig
Posts: 256
Joined: Mon Jan 09, 2023 2:02 am
Graphics Processor: nVidia (Modern GZDoom)

Re: Force partly transparent pixels to solid colour

Post by Professor Hastig »

MartinHowe wrote: Wed Jul 03, 2024 12:25 am I resent paying for software that used to be free.
The license also fits the theme. TL;DR but in short: 'you may not use this code'. :puke:
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Force partly transparent pixels to solid colour

Post by ramon.dexter »

MartinHowe wrote: Wed Jul 03, 2024 12:25 am
ramon.dexter wrote: Tue Jul 02, 2024 11:23 pm Compiling aseprite? Did you know you can buy pay money for it?
You just answered your own (slightly restated) question :p I resent paying for software that used to be free. That's why on Windows machines with HDD I still use version 7.14 of UltraDefgrag. That's why I still resent iD's choice of Final Doom (especially as they weren't written by iD). I will never charge for any DooM mods I made, ask for donations for them, Patreon, or anything like that.
Hey, that's completely legit. I just like to support developers of good software, and man, aseprite is one good example of good software. Also, I think there is even free opensource alternative called Libresprite - not sure about the name.
User avatar
MartinHowe
Posts: 2056
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

Re: Force partly transparent pixels to solid colour

Post by MartinHowe »

ramon.dexter wrote: Wed Jul 03, 2024 10:28 am Hey, that's completely legit. I just like to support developers of good software, and man, aseprite is one good example of good software. Also, I think there is even free opensource alternative called Libresprite - not sure about the name.
Understandable; if I ended up using Aesprite a lot then it is potentially justified; but in my case it's rather unlikely I'll use it that much. Thanks for heads-up about Libresprite, I'll look into that :thumb:

Return to “Assets (and other stuff)”