scale_dcci2x artefacts?


(Alex) #1

Hi,

I’m trying to scale image using dcci2x but getting scaling artefacts. Here is image:

And here is image after scaling:

I’m using such command:
–scale_dcci2x 1.5,5,0 -output jpg:123_upscale.jpg

I’m also getting two files, first with _000000 and second with 000001 suffix. I’ve tried to use online version and Krita version and both work ok, so I’m probably missing something (alpha channel?)
Thank you for help!

Best regs.


(David Tschumperlé) #2

The dcci2x algorithm has been made specifically for upscaling pixel-art images (with a low number of colors and resolutions). I doubt you’ll get something interesting with a ‘regular’ image that does not fit these constraints. I’m not really surprised by the kind of results you get actually.

I don’t know why you get two images as outputs, there are no reasons for that. Personally I get only one result. Did you type +scale_dcci2x or --scale_dcci2x instead ? It should be the reason.


(Alex) #3

Same result with +scale_dcci2x. Result from from Krita is perfect:


I’ve been using this filter from Krita since a while and all images work super fine, even such simple.


(David Tschumperlé) #4

You mean : the G’MIC plug-in in Krita, or does Krita has this filter built-in somewhere ?


(Alex) #5

G’MIC plugin in Krita.


(David Tschumperlé) #6

I don’t know what version of G’MIC you use with the command line call, I’ve just tested here with latest 2.2.2, and it works fine with your input image.
What $ gmic version tells you ?


(Alex) #7

2.2.2


(David Tschumperlé) #8

So, to be more precise. I’ve downloaded your image, as 123.jpg, then did :

$ gmic 123.jpg scale_dcci2x 1.15,5,0 output scaled_123.jpg

And I get a single file scaled_123.jpg file (size 1889x943), that looks like this (good):

I’m using gmic version 2.2.2, on my PC running Ubuntu 17.10 (artful), 64bits, installed from the debian package available from the G’MIC web page (http://gmic.eu/files/linux/gmic_ubuntu_artful_amd64.deb).

I’m not sure what is going on with your version, but I’d be interested if you do exactly the same experiment on your system, and tell us what you get.


(Alex) #9

I get same result as yours, but I think it’s not correct. Compare this to G’MIC inside Krita (left word):


There are no artifacts and all is smooth and nice…
Same result from online filter:
123_upscale_online


(David Tschumperlé) #10

Ah yes, now I understand.
The scaling algorithm allows out-of-range values to appear, so you must explicitly cut the values of the resulting image in [0,255] before saving it as a JPEG (which only handle 8bits values).
This is not necessary in the plug-in, because the cut is done automatically there.
So, the correct command line to use is:

gmic 123.jpg scale_dcci2x 1.15,5,0 cut 0,255 output scaled_123.jpg

and you get this JPEG:


(Alex) #11

Thank you so much!