Jump to content

Pixel Art Scaling Plug-in Beta Release


pikalek

Recommended Posts

Provides various pixel art scaling algorithms used in many console emulators. It's intended for enlarging low-resolution pixel and line art; use on other images may give strange results.

The original Scale2x and Scale3x algorithms were developed by Andrea Mazzoleni.

The original 2xSaI, Super2xSaI and SuperEagle algorithms developed by Derek Liauw Kie Fa (aka Kreed).

There are slight differences between my implementation Kreed's algorithms and the originals. I use the nearest valid pixel for the out of range neighbor problem. The original code uses zeroed out pixels for top and bottom out of range neighbors (resulting in the black line artifacts at the top and bottom edges) and edge wrapping for left and right out of range neighbors (sometimes resulting in color bleed along the left & right edges).

The my implementations of the Super2xSaI & SuperEagle filters do not currently work as desired. It seems like I'm interpolating differently, but I haven't found the source of the problem. Helps to check the results carefully; turns out I did fix this problem before releasing the beta.

Issues I'd appreciated feedback on:

  1. I'm not sure which sub-menu would be the best home for this effect.
  2. I was unable to associate an icon with the plug-in using Visual Studio 2005. Figured it out.
  3. I considered adding a safety check box - the basic idea is that the user would need to check the box to enable the 'Send to Clipboard' button & that the box would clear in between 'visits' to the plug-in. I got impatient trying to set this up via the IndirectUI & figured maybe it wasn't a good use of time.
  4. The original algorithms were developed in GPL projects. I wasn't clear if my code would also be GPL (I.E. if my reimplementation different enough). It was even less clear how such licensing on a plug-in would mix with a non-GPL project like Paint.NET.
  5. I don't expect anyone to debug my Super2xSaI & SuperEagle filters, but you're welcome to surprise me.
  6. It's my first plug-in; if I've made any noob mistakes, don't hesitate to tell me.

Possible future improvements:

  1. Add support for other related algorithms
  2. Add more options for the in place scaling within a selection
  3. Add selection masking when sending the image to the clipboard
  4. Fix bugs in the Super2xSaI & SuperEagle filters. Update plugin to reflect the previous code fix.

PixelArtScaling-BetaLight.zip

Edited by pikalek
Link to comment
Share on other sites

Screenshots and examples please?

I've been considering adding an "image resampler" plugin type for 4.0. Built-ins would be nearest neighbor, bilinear, bicubic, super sampling, and Fant. Then stuff like this plugin of yours could be "first class" and not have to jump through hoops.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Screenshots and examples please?

Below is the starting reference image:

TestFile.png

Below is the result from the plug-in's scale2X filter:

Plugin-Scale2x.png

Below is the result from the plug-in's scale3x filter:

Plugin-Scale3x.png

Below is the result from the plug-in's 2xSaI filter:

Plugin-2xSaI.png

Below is the result from the plug-in's Super2xSaI filter:

Plugin-Super2xSaI.png

Below is the result from the plug-in's SuperEagle filter:

Plugin-SuperEagle.png

Below is the result from the original 2xSaI implementation. Note the black line artifacts along the top & bottom and the color bleed along the upper right edge. The original implementations for Super2xSaI & SuperEagle give similar artifacts.

Control-2xSaI.png

Link to comment
Share on other sites

I've been considering adding an "image resampler" plugin type for 4.0. Built-ins would be nearest neighbor, bilinear, bicubic, super sampling, and Fant. Then stuff like this plugin of yours could be "first class" and not have to jump through hoops.

I could see some plug-ins making good use of that. While jumping through the hoops required more up front time and frustration, it also meant that I had get a better handle on the framework sooner as opposed to later.

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
  • 2 months later...

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