Gumboot Posted March 18, 2006 Share Posted March 18, 2006 (edited) This plugin has been updated (13/8/2012) ! Get the new version here: http://forums.getpaint.net/index.php?/topic/25170- OK, so I was bored and decided to spend the weekend writing a JPEG 2000 plug-in for Paint.NET... (yes, I know). Download This is basically untested, so I need people to post a message if it works for them. Especially those with 32-bit Windows (I have x64 so I'm reasonably sure that one works). [update 19/3/06 - Requires VC8 runtime] [update 20/3/06 - Hopefully fixed 32-bit crash issues] Edited August 13, 2012 by Ego Eram Reputo Linked to updated version Quote Link to comment Share on other sites More sharing options...
aatwo Posted March 18, 2006 Share Posted March 18, 2006 x86 on regular windows. I have 32 bit apparently. "Unspecified error while saving" And then it hobbles around and expires without saving anything. Quote Deviant Art Gallery Link to comment Share on other sites More sharing options...
Rick Brewster Posted March 18, 2006 Share Posted March 18, 2006 Hey Gumboot, regarding aatwo's error. Looks like this was written in Managed C++ ... did you compile with the static or dynamic linked C runtime? Works on my system though (x64, and have VS2k5 installed as well). JPEG 2000 is very slow Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Rick Brewster Posted March 18, 2006 Share Posted March 18, 2006 aatwo, try installing the VC8 runtime redistributable and see if that helps it to work for you: http://www.eecs.wsu.edu/paint.net/misc/vcredist.zip [contains both x86 and x64 redistributables, both should be digitally signed by Microsoft] Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Rick Brewster Posted March 18, 2006 Share Posted March 18, 2006 Moved to new Plugins forum Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
aatwo Posted March 18, 2006 Share Posted March 18, 2006 Holey abomination!!!!! It kind of works now after I did what you said Mr Brewster. It saves files with some random file extension that my computer can't handle and won't let me open. But now when ever I close paint.net I get this message... Is it broken? Quote Deviant Art Gallery Link to comment Share on other sites More sharing options...
Gumboot Posted March 18, 2006 Author Share Posted March 18, 2006 Hey Gumboot, regarding aatwo's error. Looks like this was written in Managed C++ ... did you compile with the static or dynamic linked C runtime? Not sure... whatever the default is. I want the static runtime, right? Where do I set this? Is it broken? I guess... yes! ;-) I must not be cleaning up all the memory correctly. I'll have another look, see if I can track it down. It saves files with some random file extension that my computer can't handle and won't let me open. What, you can't open them even with Paint.NET? BTW, thanks for the feedback aatwo! Quote Link to comment Share on other sites More sharing options...
Gumboot Posted March 18, 2006 Author Share Posted March 18, 2006 Oh yes, and the slowness is partially because I'm doing a conversion between the JasPer image format (I'm using JasPer to do the actual work) and the .net image format. In other words, it could be made faster :-) Quote Link to comment Share on other sites More sharing options...
Gumboot Posted March 18, 2006 Author Share Posted March 18, 2006 According to this page I can't use the static CRT because I'm compiling with /clr turned on. :-( If you are using the /clr compiler switch, your code will be linked with an import library, msvcmrt.lib. The import library references a new library, msvcm80.dll, which provides a proxy between your managed code and the native CRT. You cannot use the statically linked CRT ( /MT or /MTd options) with /clr. Use the dynamically-linked libraries (/MD or /MDd) instead. Which I guess means users will have to install the runtime files to get this thing to work. Quote Link to comment Share on other sites More sharing options...
aatwo Posted March 18, 2006 Share Posted March 18, 2006 No I can't open the .jp2 files even with paint.net I get the error message saying there was an unspecified error while opening the file. Quote Deviant Art Gallery Link to comment Share on other sites More sharing options...
BuzzKill Posted March 19, 2006 Share Posted March 19, 2006 Where would somebody look to see if they are running 32 bit or 64 bit Windows? Quote - DO NOT contact me asking for the .pdn of my avatar or the PDN logo. Thank you. Have a nice day. Link to comment Share on other sites More sharing options...
Rick Brewster Posted March 19, 2006 Share Posted March 19, 2006 Where would somebody look to see if they are running 32 bit or 64 bit Windows? If you have to ask, you're probably on 32-bit. But seriously, go to System Properties (right click My Computer, click Properties). If you're on 64-bit it'll say something like "Microsoft Windows XP Professional x64 Edition". Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Rick Brewster Posted March 19, 2006 Share Posted March 19, 2006 Oh yes, and the slowness is partially because I'm doing a conversion between the JasPer image format (I'm using JasPer to do the actual work) and the .net image format.In other words, it could be made faster :-) You're converting to a System.Drawing.Bitmap, or to a PaintDotNet.Document (which contains a PaintDotNet.BitmapLayer that contains a PaintDotNet.Surface) ? If the latter (PaintDotNet format), don't use the Surface class' indexer (i.e. don't use surface[x,y] = whatever format). Use pointers and Surface.GetRowAddress() instead. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Gumboot Posted March 19, 2006 Author Share Posted March 19, 2006 You're converting to a System.Drawing.Bitmap, or to a PaintDotNet.Document (which contains a PaintDotNet.BitmapLayer that contains a PaintDotNet.Surface) ?If the latter (PaintDotNet format), don't use the Surface class' indexer (i.e. don't use surface[x,y] = whatever format). Use pointers and Surface.GetRowAddress() instead. To a System.Drawing.Bitmap. And yes, I'm using LockBits(), UnlockBits(). My idea around how to speed this up was to reimplement the JasPer image type on top of a System.Drawing.Bitmap. That way, no conversion would be required. Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted March 19, 2006 Share Posted March 19, 2006 But why not just copy directly to a Surface? BitmapLayer layer = new BitmapLayer(width, height); Surface surface = layer.Surface; for (int y = 0; y { ... copy from jasper image to the surface ... } document.Layers.Add(layer); Plus, System.Drawing.Bitmap is a sealed class. The most efficient way to do this would be to decode straight into a PaintDotNet.Surface. Otherwise you're allocating a lot of memory by loading into a jasper image, then doing conversions. I noticed hundreds of megabytes of memory being allocated for the images I was trying out this plugin with. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
aatwo Posted March 19, 2006 Share Posted March 19, 2006 **pause nerd talk** I just saw a squirrel fall out of a tree **unpause** Quote Deviant Art Gallery Link to comment Share on other sites More sharing options...
Gumboot Posted March 20, 2006 Author Share Posted March 20, 2006 OK, I've had another go at it. aatwo, would you mind redownloading the plug-in and trying again? (The squirrel can wait...) Quote Link to comment Share on other sites More sharing options...
Gumboot Posted March 20, 2006 Author Share Posted March 20, 2006 Oh and Rick, the reason I was copying to a Bitmap rather than a Surface was, erm, because I didn't realize Document.FromImage() did a copy... Quote Link to comment Share on other sites More sharing options...
aatwo Posted March 20, 2006 Share Posted March 20, 2006 YYYYYYay I dont have error messages when I save it, Open it, or close my paint.net So what's the deal with these .jp2 files? Why would I ever use it and what does it do and what are the advantages and disadvantages etc etc etc. Quote Deviant Art Gallery Link to comment Share on other sites More sharing options...
Rick Brewster Posted March 20, 2006 Share Posted March 20, 2006 aatwo, I'm not completely sure myself yet, but there's all sorts of crazy info here ... http://en.wikipedia.org/wiki/JPEG_2000 Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
aatwo Posted March 20, 2006 Share Posted March 20, 2006 Whoa that web page.... blah blah blah blah blah waffle. Well I guess jp2 is a good thing! since it might become the new jpg. You should integrate it's file support with paint.net if you like! If not then I will shut up. I have no preference. Quote Deviant Art Gallery Link to comment Share on other sites More sharing options...
Born2killx Posted April 18, 2006 Share Posted April 18, 2006 I don't know what to do with that jp2 extension because I don't think my friends will be able to see it. Can you see it with the Windows Picture and Fax Viewer? Quote I built my first computer at age 11! Link to comment Share on other sites More sharing options...
aatwo Posted April 18, 2006 Share Posted April 18, 2006 No you can't. On my computer at least the only way to see a JP2 file is to use this plugin in conjunction with paint.net. Quote Deviant Art Gallery Link to comment Share on other sites More sharing options...
Born2killx Posted April 18, 2006 Share Posted April 18, 2006 oh then i guess it would be useless for my friends at my forum <_<. is png or jp2 better in your opinion? Quote I built my first computer at age 11! Link to comment Share on other sites More sharing options...
aatwo Posted April 18, 2006 Share Posted April 18, 2006 well you can't really compare the two cause each is globally (or will be globally) used for different things. They both have their own strengths and weaknesses. The thing is, at the moment jpg is primarily used for photos because I believe it optimises the colours in the image which is where is alters the colours of pixels very slightly to give the best compression with out changing the overall appearence of the image. It can give very good compression for images, and the colour optimisation that takes place does not really matter in photos because the image have thousands of colour variations in it anyways... and so that's what it is mainly used for. I am assuming that jp2 will work essentially the same way and so will essentially be used for the same purposes as the current jpg. With png people tend to use it more for cartoons, web page grapics, and stuff like that. With png if you use it to save a photo the file size will be much bigger than that of a jpg. This is because it will save the image exactly the same as the original and does not optimise it like a jpg. I personally use png for everything because it saves the image perfectly. I use it for photos and everything, not because I hate jpg, but because I am slightly compulsive and I like things to be exact. An example of jpg colour optimisation "ruining" an image would be this lagybird I drew ages ago before I knew any better... If you look at the red parts around the dots on its back you can see the image has been distorted a bit. In the originial image the back was completely red but saving as a jpg optimised the colours in this way. If I had saved the image as a png it would have saved it exactly as I drew it. The End Quote Deviant Art Gallery 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.