Bug 208959 - One pixel transparent line shown after scaling. Was: Scaling images 75% creates "blocky pixelation" with all 3 scaling algorithms
Summary: One pixel transparent line shown after scaling. Was: Scaling images 75% creat...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Transform (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-30 09:55 UTC by Kubuntiac
Modified: 2013-01-05 16:16 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Original 600px wide image (580.06 KB, image/png)
2009-09-30 09:58 UTC, Kubuntiac
Details
scaling comparison (599.41 KB, image/png)
2009-10-12 19:18 UTC, Halla Rempt
Details
Krita on left, Gimp right (661.75 KB, image/png)
2009-10-12 21:00 UTC, Sven Langkamp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kubuntiac 2009-09-30 09:55:47 UTC
Version:           rev# 1029499 (using KDE 4.3.1)
OS:                Linux
Installed from:    Ubuntu Packages

Sorry for the large file, but it needed to be both large enough and in a lossless format to show the problem. Anyway, I digress.

I have an image. When I scale (Image -> Scale to New Size) the image to 75% of its original size, there are strange blocky artefacts visible, especially on high contrast diagonal lines. I do not see these if the image is not scaled, but the view is zoomed to 75%. I do not see the problem if I scale in Gimp.

Original.png is the original (600px wide) image.

If you look at the comparison image attached there are three versions of the same image.
The one on the left is 600px wide zoomed out to 75% in Krita.
The one in the middle is scaled to 450px wide in Krita with bilinear.
The one on the right is scaled to 450px wide in Gimp with bilinear.

The problem is clearest where the black clothes meet the white skin near the neckline. It also seems to create a 1px wide transparency on the left of the canvas.


SPECS:
Kubuntu Karmic AMD64
KDE 4.3.1 (Kubuntu packages)
Krita revision# 1029499
Comment 1 Kubuntiac 2009-09-30 09:58:04 UTC
Created attachment 37258 [details]
Original 600px wide image
Comment 2 Kubuntiac 2009-09-30 10:09:25 UTC
Comparison image was slightly too large. It's uploaded to:
http://www.mediafire.com/imageview.php?quickkey=je4ftt0lovo&thumb=5

Just make sure that you *download* the image rather than just looking at it on Mediafire's site. Mediafire shows the image too small to see the problem.
Comment 3 Halla Rempt 2009-10-02 11:50:22 UTC
Thanks for the report. I can indeed see the artefacts you mention. Casper, can you look into this, please? In case mediafire makes downloading hard for you, I've got a copy of the big image locally.
Comment 4 Halla Rempt 2009-10-12 19:18:19 UTC
Created attachment 37542 [details]
scaling comparison
Comment 5 Sven Langkamp 2009-10-12 21:00:31 UTC
Created attachment 37544 [details]
Krita on left, Gimp right

I can't reproduce. Krita result looks almost identical to the Gimp one.
Could you check if you have done something special to trigger the bug?
Comment 6 enkithan 2009-10-14 12:40:23 UTC
Seems I have a related bug :
- if I flatten my .kra image, scale it to 40% in bicubic mode, and save it to png, the result is a bit aliased, and there is 1 pixel offset at the top
- if I flatten the image, save it to png, open the png, scale it at 40%, the result is correct, and as smooth as in gimp.
My test files are here : http://enkithan.free.fr/web/koffice/bugs/test-scaling.tar.bz (beware, it's a 14 mB file !)
Compare the forearm in "bicubic-sRGB-krita-bigpng.png" with "bicubic-sRGB-krita-flattened.png".

bugsbane: Did you flatten the image before scaling ? or is your original file containing several layers ?
Comment 7 Kubuntiac 2009-10-14 20:53:29 UTC
Hmmm... I *do* remember creating duplicating the only layer at the start... I don't remember if I deleted it, or flattened later and I don't have the original .kra any more.

Unfortunately I'm still having a problem of my builds not compiling, so I can't retest right at the moment. (Still trying to figure that one out)

Sorry!
Comment 8 Kubuntiac 2009-10-15 07:50:05 UTC
Wierd. I reinstalled my OS (Kubuntu 9.10 AMD64 ). Now I can compile, but I no longer get the problem, even with the exact same images and procedure. I wonder if this was fixed by some recent update in the packages / Krita code?

Enkithan, do you still get this problem with all your system packages updated and your Krita compiled from the latest code?
Comment 9 Kubuntiac 2009-10-15 07:58:18 UTC
I should add that I also have the 1px transparency you mention, except I have it on the right and bottom edges of the canvas.
Comment 10 enkithan 2009-10-15 13:44:12 UTC
bugsbane: yes all my apps are up-to-date, and koffice trunk is from yesterday.

I did more testing, and like CyrilleB suggested to me on IRC, the pixel line at the top is caused by layers bigger than the canvas. Saving to PNG crop the image to canvas size, so that explain why the bug isn't happening then.
An interseting thing is that on my last test file, the aliasing/scaling itself is correct.
So I think maybe my previous image is correctly scaled too, but pixels fall in the worst-case rendering scenario because of the shift.
Comment 11 Camilla Boemann 2010-01-01 12:47:41 UTC
I'm wondering if we can then close this bug, or keep it open only regading the transparent line?

comments please
Comment 12 Halla Rempt 2012-02-29 15:04:08 UTC
Bug has been renamed.
Comment 13 Dmitry Kazakov 2013-01-05 16:16:22 UTC
I've just pushed the fix for the interpolation and border bugs mentioned there.