Josh Posted June 14, 2016 Share Posted June 14, 2016 I'm trying to convert this PNG image into a bitmap and retain the alpha channel, and nothing is working. Does anyone know how to do this?: http://a2.mzstatic.com/us/r30/Purple6/v4/45/99/be/4599beb5-9f5b-820b-c0b4-7936727f6949/icon256.png Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
martyj Posted June 14, 2016 Share Posted June 14, 2016 What are you using to convert it? I only have GIMP at work. http://martyj.phpdev.gurutech.ws/images/icon256.bmp Quote Link to comment Share on other sites More sharing options...
macklebee Posted June 14, 2016 Share Posted June 14, 2016 I only have GIMP at work. http://martyj.phpdev.gurutech.ws/images/icon256.bmp What options did you use to save? Just wondering because the alpha is there but it removed the color from the non-alpha parts when brought into the Editor as shown in the picture on the left. When I saved Josh's png using Gimp as a 32-bit A8 R8 G8 B8 bitmap, it looks like the one on the right when brought into the Editor. icon256_32bit.bmp Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Josh Posted June 15, 2016 Author Share Posted June 15, 2016 The bitmap you posted above has a black background shown in Windows Explorer, and when the Windows API loads it. I am doing OS graphics stuff, not Leadwerks textures. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
tjheldna Posted June 15, 2016 Share Posted June 15, 2016 Try this. It's saved as a 32bit with a calculated alpha channel. icon256.bmp Quote Link to comment Share on other sites More sharing options...
Josh Posted June 15, 2016 Author Share Posted June 15, 2016 Dude, just look at the image icon on your desktop. If it's not transparent, it;'s not working. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
gamecreator Posted June 15, 2016 Share Posted June 15, 2016 They are all transparent, even if the desktop icons don't represent them correctly. Open them in a free program like XnView which lets you change the background, set it to something obvious like orange and you'll see. macklebee's version seems to preserve the shadow at the bottom correctly too. You can change the background color in XnView by going to Tools, Options, View (on the left), Background Color. You may have to restart the application to display the images correctly. Quote Link to comment Share on other sites More sharing options...
knocks Posted June 15, 2016 Share Posted June 15, 2016 A bmp would need to be converted to an ico file to show a transparent preview on the desktop. Quote My first Adobe purchase was Photoshop 2.0, CS6 was my last! < = > Link to comment Share on other sites More sharing options...
gamecreator Posted June 15, 2016 Share Posted June 15, 2016 Josh's original PNG also shows transparency correctly as an icon but apparently BMPs don't, at least on some OSes. The BMPs also load differently in Photoshop - they come with a separate Alpha channel layer. The PNG doesn't and yet it has transparency as well. Quote Link to comment Share on other sites More sharing options...
martyj Posted June 15, 2016 Share Posted June 15, 2016 My Bitmap does have transparency. I loaded it in a web browser changing the background color to whatever I wanted. http://martyj.phpdev.gurutech.ws/images/icon256.html Windows might not show the color right in explorer.exe. But the color is right. Here is the options for exporting. What are you trying to do in win32? Set an icon for a button? Quote Link to comment Share on other sites More sharing options...
Josh Posted June 15, 2016 Author Share Posted June 15, 2016 Hmmmm, it looks like Windows doesn't support bitmaps with alpha channels? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Athos Posted June 15, 2016 Share Posted June 15, 2016 There's an AlphaBlend() function that seems to support per-pixel alpha value. If you are doing it for icons in a ImageList, you may need to separate the alpha channel in a different bitmap. Quote Link to comment Share on other sites More sharing options...
Josh Posted June 15, 2016 Author Share Posted June 15, 2016 Okay, thank you all for your suggestions. It turns out GDI+ has a nicer image drawing function and it supports PNG files. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Bolt Posted June 17, 2016 Share Posted June 17, 2016 Just some extra info if anybody is interested. PNG files support transparency, but they don't utilize it as an alpha channel, like you might find in 32-bit TGA or BMP files. If you load this PNG file into Photoshop, you will see transparency, but no alpha channel. Which may seem a bit confusing. In Photoshop, you can convert transparency to an alpha channel, by Ctrl+clicking on the layer icon, then open the Channels window, and click on the "Save selection as channel" button, to create a new alpha channel. This can then be saved as a 32-bit TGA or BMP file. 3 Quote Ultimate Unwrap 3D: http://www.unwrap3d.com Link to comment Share on other sites More sharing options...
gamecreator Posted June 17, 2016 Share Posted June 17, 2016 Good info Bolt. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.