Jump to content


Photo

Alpha 32bits Bitmap Support for Paint.NET


20 replies to this topic

#1 FremyCompany

FremyCompany
  • Newbies
  • 5 posts
  • Reputation:0

Posted 08 August 2008 - 07:32 PM

If you want to edit .MSSTYLES or another DLL or ressources files (to make new skin/style for Windows XP or another application that use 32bpp bitmaps), you will probably see that a great amount of images the windows's skins are using are 32bits-bitmaps. And when you open these bitmaps on almost all applications, the alpha chanel is dropped due to the non-support of this sort of BMP in Windows Bitmap Loading API (for win 3.1 / win 95 historical reasons).

Paint.NET doesn't escape from the rule and load/save bitmaps as they were in 24bpp.

This plugin allow you to open and save file in 32-bit bitmap.
The only thing you must do is to rename it to *.bmpx (to avoid conflit with the existing PDN's BMP handler).
If you try to open non-BMP files, you should receive an error (rem: 24bpp bitmaps are loaded correcty too).

This plugin is perfectible and I'll publish updates if you find bugs/things to change.

Changelog [2.6 <== 1.xx] :
- Application optimised
- Fixed a problem of 1px translation on Windows
- Support now all bitmaps (and not only 32bpp)

Attached Files


  • 0

#2 Deadl0ck

Deadl0ck
  • Newbies
  • 6 posts
  • Reputation:0

Posted 03 December 2008 - 01:25 PM

ooh... I've been waiting for this! :D

There is however a bug in the current version... the whole image is shifted 1 pixel to the left in the resulting bitmap...
  • 0

#3 FremyCompany

FremyCompany
  • Newbies
  • 5 posts
  • Reputation:0

Posted 06 December 2008 - 10:58 AM

Yes, I already have seen this little bug, but this is not a problem in my code but a problem with some mis-encoded bitmaps....

The problem is that Windows (XP up to Vista) doesn't support 32bits bitmaps, and they shift properly written bitmapts by 1px. Others applications and OS doesn't (try opening your images with Safari for Windows, you should not see the 1px-shiftage).

In a future version, I could give the possibility to read/write the bitmap in both formats. But because nobody has responded to my message, I've not worked on my plugin anymore because he worked well for my own use. If you are interested, I can publish another version in 1 or 2 weeks (now I've examens at school).

Fremy
  • 0

#4 Deadl0ck

Deadl0ck
  • Newbies
  • 6 posts
  • Reputation:0

Posted 10 December 2008 - 01:27 AM

Yes I would indeed be interested :-)

I think the shifting of the bitmap is actually by MS design, not sure why though. I'm using the 32-bit bitmaps for custom theming a Windows application and load the bitmap using standard Windows API calls (Windows XP/Vista DOES support 32-bit bitmaps internally :wink: in fact... the whole theming support is based around the format, explorer doesn't display them correctly though paradoxially enough) anyway... though without the manual shifting before saving in PDN with your plugin it will appear displays shifted 1px.

Actually... I did notice that reopening a manually shifted image using your plugin will open the image unshifted in PDN... so it looks like it is suppose to look... problem is that when making changes and saving again it will be shifted again. So (to me) it appears like it should simply always shift 1px on saving and that's that...
  • 0

#5 dcook

dcook
  • Newbies
  • 1 posts
  • Reputation:0

Posted 20 December 2008 - 06:08 AM

I made a few fixes and improvements. It doesn't handle all types of BMP files, but this is good enough for my needs.

Attached Files


  • 0

#6 pyrochild

pyrochild
  • Administrators
  • 11,480 posts
  • LocationColorado
  • Reputation:201

Posted 20 December 2008 - 07:38 AM

You should keep all updates in the first post.
  • 0
xZYt6wl.png
ambigram signature by Kemaru

[I write plugins and stuff]

If you like a post, upvote it!

#7 dev

dev
  • Newbies
  • 3 posts
  • Reputation:1

Posted 02 February 2010 - 09:15 PM

It looks like this uses Bit Field compression which apparently is not understood by the Win32 LoadImage() API function. I created a similar one-pixel 32-bit BMP image in both Gimp and Paint.NET (using this plug-in) and I could load the Gimp image but not the Paint.NET one in my Win32 app. The only difference I could see is the compression method (Gimp doesn't use one).

[Edit]
If anyone is interested, I've made some changes to the source so that the BMP no longer uses compression. This version should play nice with Win32 LoadImage().

Attached Files

  • Attached File  BmpX.zip   6.04KB   1601 downloads

  • 1

#8 Ego Eram Reputo

Ego Eram Reputo

    2013 Proton Award Winner

  • Moderators
  • 7,493 posts
  • LocationNorth Canterbury, New Zealand
  • Reputation:544

Posted 03 February 2010 - 09:16 PM

Thanks for the update. Could you change it to a ZIP file?
  • 0

#9 dev

dev
  • Newbies
  • 3 posts
  • Reputation:1

Posted 04 February 2010 - 03:44 AM

Thanks for the update. Could you change it to a ZIP file?

Yes, sorry. I found a bug with it, too, so I'm making a couple changes, then I will re-upload in ZIP format.
  • 0

#10 Ego Eram Reputo

Ego Eram Reputo

    2013 Proton Award Winner

  • Moderators
  • 7,493 posts
  • LocationNorth Canterbury, New Zealand
  • Reputation:544

Posted 04 February 2010 - 08:16 AM

Thanks. We have enough trouble with ZIP files without introducing RAR files too :lol:
  • 0

#11 dev

dev
  • Newbies
  • 3 posts
  • Reputation:1

Posted 04 February 2010 - 02:10 PM

Thanks. We have enough trouble with ZIP files without introducing RAR files too :lol:

:mrgreen: , I hear ya. ZIP file uploaded. Turns out there weren't any bugs afterall (at least not to MY knowledge). Just some differences in the way transparency is treated (Gimp uses black with an alpha channel of zero, PDN uses white). It did give me the chance to add comments where I made changes to the original code, though.
  • 0

#12 L3ron

L3ron
  • Members
  • 436 posts
  • LocationLower Saxony
  • Reputation:0

Posted 07 March 2010 - 03:51 PM

Cool, I'm updating my PDN and found that you'll did a graet job with this plugin :)
  • 0

#13 Andrewr05

Andrewr05
  • Newbies
  • 4 posts
  • Reputation:0

Posted 08 April 2011 - 02:49 AM

Anyone have a copy of this plugin?

The links are all dead.
  • 0

#14 Ego Eram Reputo

Ego Eram Reputo

    2013 Proton Award Winner

  • Moderators
  • 7,493 posts
  • LocationNorth Canterbury, New Zealand
  • Reputation:544

Posted 08 April 2011 - 02:53 AM

Some forum attachements have been lost or corrupted in the recent forum outage. If the link cannot be resurected the plugin may have to be uploaded again.


  • 0

#15 Andrewr05

Andrewr05
  • Newbies
  • 4 posts
  • Reputation:0

Posted 08 April 2011 - 03:09 AM

Some forum attachements have been lost or corrupted in the recent forum outage. If the link cannot be resurected the plugin may have to be uploaded again.

Thanks for the quick reply, should I PM the OP of the thread and ask him/her to reupload the file?
  • 0

#16 Ego Eram Reputo

Ego Eram Reputo

    2013 Proton Award Winner

  • Moderators
  • 7,493 posts
  • LocationNorth Canterbury, New Zealand
  • Reputation:544

Posted 08 April 2011 - 07:47 AM

Original poster was last here in May 2008, I suspect that a PM would be a waste of time.

Give it a couple of days. If we can't locate the attachment at least we have the source file to try and recreate the plugin.
  • 0

#17 pyrochild

pyrochild
  • Administrators
  • 11,480 posts
  • LocationColorado
  • Reputation:201

Posted 08 April 2011 - 04:45 PM

I've recompiled it from the source, which is apparently the only working attachment in this thread. Lemme know if it works...

Edit: removed, as the attachments above have been restored.
  • 0
xZYt6wl.png
ambigram signature by Kemaru

[I write plugins and stuff]

If you like a post, upvote it!

#18 Duck

Duck
  • Members
  • 16 posts
  • Reputation:1

Posted 23 April 2011 - 02:47 AM

I've recompiled it from the source, which is apparently the only working attachment in this thread. Lemme know if it works...


No, it DOES NOT WORK.

However, I have used the plugin from #7 successfully to edit a transparent bmp in an exe file, so #7 is good for sure. A mod should edit post #1 to point to post #7.

Edited by Duck, 23 April 2011 - 02:50 AM.

  • 1

#19 Ego Eram Reputo

Ego Eram Reputo

    2013 Proton Award Winner

  • Moderators
  • 7,493 posts
  • LocationNorth Canterbury, New Zealand
  • Reputation:544

Posted 23 April 2011 - 04:34 AM

A mod should edit post #1 to point to post #7.

If you ask nicely, Pyrochild might do it for you. He was good enough to recompile the original after all.

You should not forget the power of politeness. PLEASE and THANK YOU go a long way around here.
  • 0

#20 Duck

Duck
  • Members
  • 16 posts
  • Reputation:1

Posted 23 April 2011 - 01:40 PM

Yes it was like gone 3am I was tired just trying to post that to save other people a load of hassle trying to get it to work.
  • 0