Jump to content

How to correctly edit a PNG file with alpha channel?


Recommended Posts

As you can see the texture of the gigantron model have large transparent areas. But whenever I edit and save the file (or even just save it without editing), every transparent turns into black. I use Gimp, paintDOTnet, and infranview. To my knowledge Gimp can save alpha channels. Also if the rest of the texture for the Gigantron is not in this png file, then where does KSP store it?

ZVAhBMB.png

You can also see how I used a painful manual method to locate the missing texture places on another part:

http://forum.kerbalspaceprogram.com/threads/68174-ION-engine-modification?p=943553#post943553

Link to comment
Share on other sites

I only know how to edit them in Photoshop. You just need to make sure that the background/base layer is empty - completely transparent. When you save it out, don't flatten the image - just do file > save as > png. Sadly I don't know about editing PNGs in those other apps =\

Link to comment
Share on other sites

Make sure that you're in RGB mode and make sure you're saving as 32 bit. Not sure if it matters for Gimp but you might need to have an actual alpha channel present with the transparency information.

To be honest though I've always had trouble with PNGs and their alpha channels because it seems like no modern graphics editing packages properly preserve alpha in pngs.

I recommend just going with 32 bit TGA and making sure it has the alpha present. You can even compress it if Gimp supports that.

Link to comment
Share on other sites

KSP uses the alpha channel for specular maps, the parts you can't see are likely just completely flat and non-shiny so are mostly transparent.

To flatten the alpha channel (and keep the map so you can re-apply the spec afterwards) you need to make sure you've got the channels tab in your toolbar.

AunemXv.png

It looks like this.

You can deselect all the colour channels and paint over the alpha to remove all transparency from the image.

You'll probably want to save the alpha so that you can re-apply the spec later, and you can do that by going to:

Colours > Components > Decompose

This will open up all the component channels from the image in a separate file, on multiple layers.

2wtfcc3.png

There's the solar panel texture in all its glory.

Link to comment
Share on other sites

  • 2 months later...

When editing cloud maps (PNG's) do you guys know what the best setting are to keep?

Should I interlace when saving?

My cirrus cloud layer appears (with max lighting/brightness settings) a transparent bluish hue not the powerful white of the other layers :/

4wJY8bm.jpg

Edited by pingopete
Link to comment
Share on other sites

I have always found paint.NET to be an acceptable choice after several months of use, you just need to get the right plugins to make it easier.

Which are?

Is there a plugin for paint.net that makes it show the part of the image that is in the rgb channels when the alpha channel is black? (seriously that makes paint.net all but useless to me, i only use it to convert 16 bit png to 32 bit, and edit in an old version of photoshop)

And related to that, a plugin that can show the contents of the channels separately, like photoshop does?

Link to comment
Share on other sites

Weird that you have a problem with Gimp. I've been using it (fairly casually) for over a decade and cannot remember a time where I opened a file with transparency, edited it, and saved it where it failed to remember the transparency of the original image.

Granted, if you open a PNG and saved a JPG, transparency will be lost. But open a PNG, edit, save as PNG has always worked. I didn't know there was a way to make it not work :)

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...