Sign in to follow this  
Followers 0
Hawkynt

2D Image Scaling Algorithms

59 posts in this topic

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?

0

Share this post


Link to post
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.

0

Share this post


Link to post
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.

0

Share this post


Link to post
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
0

Share this post


Link to post
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
0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0