Jump to content

2D Image Scaling Algorithms


Hawkynt

Recommended Posts

50 posts in this thread. I understand that this plugin is still in development, but when are you planning to release it to the general public?

Link to comment
Share on other sites

OK could you tell me which weights you use for blending ?

formula is

c=(a*n+b*m)/(n+m)

Just need to know the values n and m for each blend case to fix that.

Your code was optimized so I thought these were yours (could you pls confirm?):

32W 7:1

64W 3:1

128W 1:1

192W 1:3

224W 1:7

Those proportions are right. I can confirm this.

Link to comment
Share on other sites

This is the plugin Developers section of the forum. Many users will not be aware that this plugin is available.

Reposting the plugin in the Plugins forum with a description of what it does and a how-to guide to usage (screenshots!) would make all the users aware of it.

Link to comment
Share on other sites

OK we'll do that when we got this XBr working as expected.

Hyllian, I tracked your 3x differencies back in code, thanks for the standalone version. Without it I wouldn't been able to find the differencies. It's like I assumed earlier: You changed your filter code over time so this is the difference in 3x FILTRO:


#if ORIGINAL_IMPL
     if ((e < i) && (!_IsEqual(pf, pb) && !_IsEqual(ph, pd) || _IsEqual(pe, pi) && (!_IsEqual(pf, i4) && !_IsEqual(ph, i5)) || _IsEqual(pe, pg) || _IsEqual(pe, pc))) {
#else
     if ((e < i) && (!_IsEqual(pf, pb) && !_IsEqual(pf, pc) || !_IsEqual(ph, pd) && !_IsEqual(ph, pg) || _IsEqual(pe, pi) && (!_IsEqual(pf, f4) && !_IsEqual(pf, i4) || !_IsEqual(ph, h5) && !_IsEqual(ph, i5)) || _IsEqual(pe, pg) || _IsEqual(pe, pc))) {
#endif

The Part in the ORIGINAL_IMPL is the one from your standalone, the one below is the one from your original C-sources. I'll now continue on the 4x and 2x differencies. Can you tell me which of all your 2x'es you used ?

Edit: 4x is also solved, you used 4x v2 which is slightly different.

Edit: 2x is solved, you used 2x v5.

I'll release the current version.

Edited by Hawkynt
Link to comment
Share on other sites

OK we'll do that when we got this XBr working as expected.

Hyllian, I tracked your 3x differencies back in code, thanks for the standalone version. Without it I wouldn't been able to find the differencies. It's like I assumed earlier: You changed your filter code over time so this is the difference in 3x FILTRO:


#if ORIGINAL_IMPL
if ((e < i) && (!_IsEqual(pf, pb) && !_IsEqual(ph, pd) || _IsEqual(pe, pi) && (!_IsEqual(pf, i4) && !_IsEqual(ph, i5)) || _IsEqual(pe, pg) || _IsEqual(pe, pc))) {
#else
if ((e < i) && (!_IsEqual(pf, pb) && !_IsEqual(pf, pc) || !_IsEqual(ph, pd) && !_IsEqual(ph, pg) || _IsEqual(pe, pi) && (!_IsEqual(pf, f4) && !_IsEqual(pf, i4) || !_IsEqual(ph, h5) && !_IsEqual(ph, i5)) || _IsEqual(pe, pg) || _IsEqual(pe, pc))) {
#endif

The Part in the ORIGINAL_IMPL is the one from your standalone, the one below is the one from your original C-sources. I'll now continue on the 4x and 2x differencies. Can you tell me which of all your 2x'es you used ?

Edit: 4x is also solved, you used 4x v2 which is slightly different.

Edit: 2x is solved, you used 2x v5.

I'll release the current version.

Yes, great job!

That old "if" is my implementation for sharp 90 degree edges, similar to yours. The new version is a bit soft in that restriction, so that only some sharp edges are left intact. I like the new way more because it doesn't cause those nasty artifacts I pointed earlier. You could use the three ways (rounded, sharp and sharpest) in your software.

Edited by Hyllian
Link to comment
Share on other sites

  • 11 months later...
  • 3 years later...

My gimp plugin for scaling algorithms: https://www.dropbox.com/s/2gmgp2tair3r2wa/scale2x.py?dl=0

Download gimp, then move the plugin to C:\Program Files\GIMP 2\lib\gimp\2.0\plugins.

The xBR implementations are no-blend.

Image you should use:

srYgTWO.png

Results: https://www.dropbox.com/sh/2jybtkqvktz7fgy/AABp_lpsc-g0shkYDhimuxura?dl=0

Note: xBR implementations have the difference functions replaced by equality. One part of xBR picks a pixel with least difference from original (which is used in the enlarged pixel) and I couldn't reproduce it. I added edge detection to fix it. The modified version of xBR 3x rounds the tips of 1-thick lines and single pixels. xBR 2x only interpolates bottom 45° triangles for a full pixel in the enlarged pixel. This makes the 45° lines and triangles look good, but slightly biased upward. The alternative version interpolates 45° triangles for a full pixel if no other corner has a triangle. This makes the images similar to Scale2x (good 1-thick lines only). Still better than your version which has no good 45° shapes.

Edited by Piotr
Link to comment
Share on other sites

  • 6 months later...

@BoltBait! WIN10 Defender prevents me from downloading this link for the paint.net plugin. It allowed me to download the standalone executable just fine. The app is now a standalone exe. that has nothing to do with paint. Tested and it works fine. Closing this thread and removing the link might be a good idea.

PaintNetSignature.png.6bca4e07f5d738b2436f83d0ce1b876f.png

Link to comment
Share on other sites

41 minutes ago, AndrewDavid said:

WIN10 Defender prevents me from downloading this link for the paint.net plugin.

Well, that's an old version anyways. Get the newest one (r133) from here:

https://forums.getpaint.net/index.php?/topic/24270-hawkynts-2d-imagefilter-library/

(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

  • 6 years later...

I signed up here only to say it would be wonderful if author Hawkynt could add Hyllian's algorhythm to the project. I loved Hawkynt's work, but Hyllian's version can be extremely useful. 
 

On 1/11/2012 at 3:57 PM, Hyllian said:


Hyllian, the links to standalone app look like down, can you upload again please? Also can you make yours a separate plugin at least, in case Hawkynt would not include? (And many years passed already sadly)

Thanks to Hawkynt and Hyllian very much for their great works. 

Link to comment
Share on other sites

7 hours ago, Farwest said:

it would be wonderful if author Hawkynt could add Hyllian's algorhythm to the project
...
Hyllian, the links to standalone app look like down, can you upload again please?


@Farwest be aware that Hawkynt has not visited this forum for 7 years and Hyllian has been gone for 12 years, so you are unlikely to get a response.

Link to comment
Share on other sites

7 hours ago, Tactilis said:


@Farwest be aware that Hawkynt has not visited this forum for 7 years and Hyllian has been gone for 12 years, so you are unlikely to get a response.

 

Yes, I am aware of it, thank you, yet I tried my chance. Maybe they get notified in their emails and they check after that, who knows?

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