# 2D Image Scaling Algorithms

## 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?

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

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

##### 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
##### 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
##### Share on other sites

• 11 months later...

deleted

Edited by aliaspider
##### Share on other sites

• 3 years later...

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

The xBR implementations are no-blend.

Image you should use:

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
##### Share on other sites

Piotr, that does nothing to help paint.net users. Post on-topic or I'll ban you for spamming.

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

##### Share on other sites

41 minutes ago, AndrewDavid said:

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

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

##### Share on other sites

Thanks @toe_head2001. Guess I should read more closely to EERs notes.  Now lets see if its of any use.

##### Share on other sites

Much better upscaling algorithms out there, if you ask me. But, draw your own conclusions.....

##### 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:

Hi,

Is there any possibility to include my algorithm?

Here an explanation: http://board.byuu.org/viewtopic.php?f=10&t=2248

Some standalone app here: http://www.wayofthepixel.net/pixelation/index.php?topic=13508.0

Sources xBR in Paintwon game: http://paintown.svn.sourceforge.net/viewvc/paintown/trunk/src/util/sdl/xbr.cpp?revision=6823&view=markup

Original:

4xBR:

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.

##### Share on other sites

7 hours ago, Farwest said:

it would be wonderful if author Hawkynt could add Hyllian's algorhythm to the project
...

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

##### 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?

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×