Jump to content

Transparent background disappearing?


Recommended Posts

I am a beginner with Paint.net but am not using it for anything advanced just need some custom map symbols.  I am downloading some simple 256X256 .png files that I then reduce to 16X16 and save as .bmp 24 bit.  The original .png files have what I would call a "transparent" background.  Looks like a checkerboard gray and white pattern.  But when the .png file is used as is, the only thing that shows is the symbol itself.  In other words if the symbol was a black X and was inserted on the map only the X would show, no opaque background.  This is what I need.  But after reducing the size to 16X16 and saving as .bmp 24 bit, and then using the file, the background has changed to solid white which of course makes a white square on the map.  Why is this happening and how can I keep the original transparent background that is in the downloaded .png file?  Thanks.

 

I have read other threads, including one just below this one, that sort of ask similar questions.  But what they are doing is much more complicated than what I want and don't directly state how to preserve the transparent background of the original .png.  I have read other places that to make a pixel transparent, set its color to magenta (RGB = 255, 0, 255), but I don't see how to do that or understand if it would even work.

Edited by WillT
Link to comment
Share on other sites

Greetings WillT,

Since BMP files don't support alpha channel you loose transparency when you save. In PDN resize the original file to the dimensions you need and save as a PNG or TIFF to preserve transparency. (Give the file a new name or add a number to the old name as to not overwrite the original PNG.)

Edited by HyReZ


 

Link to comment
Share on other sites

Thanks.  The maps I am working on are to be used on Garmin GPSrs and Garmin BaseCamp.  Below are the exact instructions I am trying to follow.  The files need to be .bmp to work with the Garmin products.  Other people have done this using Paint.net and I have used their map icon/symbols.  They are in .bmp format and have no square background that blocks out part of the map.  What they tell me is to be sure to use the correct color depth which I don't see how to do.  Their icons when viewed in windows have magenta backgrounds while mine do not.  So I am missing how to do it correctly. 

 

When I have asked them all they tell me is that they use Paint.net and follow the below instructions. I know it says the files can be either .bmp or .png, but the reality is that .png does not seem to work with Garmin when you are trying to sync and use the same symbols on both the GPSr and in BaseCamp.  So everyone uses, and Garmin now says, use .bmp files. The files I have been sent that are done by others and ready to go are .bmp with the symbol on the magenta background and work perfectly.  I just can not get the symbols I am making myself to have the magenta background instead of opaque white.   I believe it is the 3rd bullet point that they are doing correctly and I am not.  How do I accomplish that?  Thanks again for the help.

 

  • Saved as a 24-bit Windows Bitmap (.BMP) or Portable Network Graphics (.PNG) file format
  • Saved named must be 000 through 063 (E.G., 044.BMP or 044.PNG) 
  • Transparency is allowed by using the RGB color Magenta(255,0,255) or hex color code: ff00ff

Found Garmin's current instructions on this which are basically the same but no longer recommending the .png format:

 

  1. Create a custom symbol with the following guidelines:
    • Create an image that is no larger than 32 pixels in width or height
    • Create transparent pixels by setting the color to magenta (RGB= 255, 0, 255)
  2. Save the custom symbol with the following guidelines:
    • If applicable, ensure no color space information is saved
    • Ensure the image is saved as a 24-bit Windows-style bitmap format (typically located in Save As dialog box, under advanced options)
Edited by WillT
Link to comment
Share on other sites

You need two layers. You will also need Boltbait's Tranparency plugin.

The upper layer is your image with transparent background.

Use the bucket to cover the bottom layer with color FF00FF. Then run the Transparency adjustment plugin and bring the slider down to -100.

Save it as a PNG file. :) 

Link to comment
Share on other sites

2 minutes ago, Eli said:

You need two layers. You will also need Boltbait's Tranparency plugin.

The upper layer is your image with transparent background.

Use the bucket to cover the bottom layer with color FF00FF. Then run the Transparency adjustment plugin and bring the slider down to -100.

Save it as a PNG file. :) 

 

I will look at that and see if I can figure out what you are saying.  But as noted above, the file needs to be saved as a .bmp file, not .png so not sure if that will work.  I do know it is possible because I have several symbol files made by others using PDN that are .bmp files.  They show up on the Garmin products with no background and when viewed in Windows, they have a magenta background.

Link to comment
Share on other sites

I am hearing that but I have several .bmp files that work.  They were made following the instructions I posted above, (which I can't seem to follow correctly).  They have transparent backgrounds, (or maybe no backgrounds), when displayed on the Garmin products.  They have magenta backgrounds when viewed in Windows Explorer so maybe they are not actually transparent? I was going to upload one of the files I have that are .bmp files but the forum here will not allow an upload of a bmp file so here is a screen shot (which is.png) of one of the icons, (that is.bmp) that works. (I did not make it.)

 

 

symbol.PNG

Edited by WillT
Link to comment
Share on other sites

12 minutes ago, BoltBait said:

 

BMP files don't support transparency.

 

Maybe I am using the wrong descriptions?  Maybe the .bmp file I have that work great, like the one in the screen shot above, do not actually have transparent backgrounds.  Maybe they create the "appearance" of a transparent image somehow with this step which I do not understand how to do: 

    • Create transparent pixels by setting the color to magenta (RGB= 255, 0, 255)
Link to comment
Share on other sites

@Eli Yes!  I bet you are correct and that makes sense to me reading the instructions posted above from Garmin.  So now I should refine the original question to this:

 

How do I take an image file and save it so that it has the FF00FF or 255, 0, 255 color like in the posted screenshot above or this one below.  I can't find how to do it in PND.  

Here are the Garmin instructions again that others are following successfully somehow. At least one person does it using PDN.

  1. Create a custom symbol with the following guidelines:
    • Create an image that is no larger than 32 pixels in width or height
    • Create transparent pixels by setting the color to magenta (RGB= 255, 0, 255)
  2. Save the custom symbol with the following guidelines:
    • If applicable, ensure no color space information is saved

Symbol2.PNG

Edited by WillT
Link to comment
Share on other sites

OK.  Going out for a hike right now but I will try again later.  I just tried and was able to get a second layer added but the first one with the symbol insists on being labeled background.  Does that matter?  What does "flatten" layers mean?

Link to comment
Share on other sites

1 hour ago, Eli said:

I think  that the GARMIN software is just using a workaround and everytime it sees FF00FF it converts the color to display as transparent.

 

Eli is absolutely correct. Using Magenta for transparent areas is a very established practice. It was very common in the days of Windows 9x.

 

42 minutes ago, WillT said:

  I just tried and was able to get a second layer added but the first one with the symbol insists on being labeled background.

 

The labels on layers do not matter from a technical stand point. You can name them anything you want.

 

44 minutes ago, WillT said:

What does "flatten" layers mean?

 

It means merging all layers into a single layer.

 

https://www.getpaint.net/doc/latest/WorkingWithLayers.html

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

For <No cursing.>'s sake HyReZ!... they link to the MEGALO pack?

 

Sorry for the bad language and happy new year everyone ... I'm sure users will be more offended by downloading a virus than by me using a naughty word!

 

Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings

 

PdnForumSig2.jpg

Link to comment
Share on other sites

So thanks all!  I got this to pretty much work.  I have a file like in the screenshot below.  I size it down to 32X32, save it as a .bmp with the layers flattened, and it works fine on both the GPSr and in BaseCamp.  So I am almost there.  But one thing that is happening that I don't understand. Once saved it looks fine in Paint, but when used in Garmin BaseCamp and on the GPSr, it does have a "transparent" background as expected, showing only the sign post...  Except that there is a shadow or bleeding or something of the magenta color all around the signpost. So it is as if there is a magenta glow coming out from behind the post?  What is that from and is there a way to fix it?

Symbol3.PNG

Link to comment
Share on other sites

It looks unlikely that the Garmin bmp/magenta hack has levels of transparency? - binary...either opaque or clear(signalled by magenta)?
If that is the case? (ToeHead will know) then few options.

Possibly, set Secondary 'color' to magenta and use 'Two tone threshold', with the sliders together to get the best outcome?
There are probably many other ways - but it seems unlikely you will get smooth edges - but it's a 32px icon - no-one notices!;-)

... There is probably a better answer waiting.

  • Like 1

 

Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings

 

PdnForumSig2.jpg

Link to comment
Share on other sites

38 minutes ago, Red ochre said:

For ... sake HyReZ!... they link to the MEGALO pack?

 

The Megalo site has been offline for about a year now.  So it's not much harm anymore.

 

8 minutes ago, Red ochre said:

It looks unlikely that the Garmin bmp/magenta hack has levels of transparency? - binary...either opaque or clear(signalled by magenta)?

 

Yeah, it's just binary: Transparent or Opaque.

 

3 minutes ago, WillT said:

I have from other places that do work,(like the ? a few post above), don't do that

 

If you take a close look at the  ?  image, it doesn't uses Alpha Blended edges. Or in other words, it has aliased edges as opposed to anti-aliased edges.

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

You're probably going to have to decide on on black (or whatever colour you want) and magenta (deemed as transparent), that means the edges will look jagged but, unless I'm wrong - could well be,  the only option is to divide the image into opaque or transparent?

 

Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings

 

PdnForumSig2.jpg

Link to comment
Share on other sites

1 minute ago, toe_head2001 said:

If you take a close look at the  ?  image, it doesn't uses Alpha Blended edges. Or in other words, it has aliased edges as opposed to anti-aliased edges.

That is a foreign language to me.  I have no idea what you mean but that may be the real problem, my lack of knowledge. I just read a couple of Google links to aliased edges so I understand it a little.  A couple of things here on this forum talk about aliased vs anti aliased and discuss how the 2nd layer is filled.  I did not really follow it though.  Could it be the way I filled the magenta layer with the bucket set to global? 

Link to comment
Share on other sites

13 minutes ago, toe_head2001 said:

The Megalo site has been offline for about a year now.  So it's not much harm anymore.

 

Fabulous news!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...