Page 1 of 1

un probleme avec / problem with "-levels 1 213"

Posted: Sat Jul 29, 2017 4:05 pm
by payaxnv
bonjour (Englih(?) is at the end)
je cherche a récupérer de vieux scans qui sont un peu gris et de faible résolution.
Dans xnview ca marche plutot bien avec:

Code: Select all

nconvert -levels 0 213 -ratio -rtype lanczos -resize shortest 1920  
mais qund j'inclus cette commande dans un BAT (avec nconvert donc) j'ai des images qui sont éclaircies (grillées, beaucoup plus que lors du traitement manuel) sur environ le 1/4 supérieur, le reste étant inchangé.
J'ai essayé de séparer l'aclircissement du redimensionnement, de changer de format JPG> eclaircissement et BMP > JPG
rien n'y fait . EX (elles sont toutes comme ca !)
img_1920_RSD_003.jpg
il y a t il un moyen de contourner cela ?
d'autant plus frustrant que ca marche mannuellement :|

Hello;
trying to clean old scans, without real white and black
in xnconvert treatment and conversion work well
"export to nconvert" is:

Code: Select all

nconvert -levels 0 213 -ratio -rtype lanczos -resize shortest 1920  
when this line is used in a BAT file it makes the upper quarter of each image many more clear than specified, the 3/4 untouched

i have try to put

Code: Select all

-levels 0 213

at different pales, i try to convert in different formats, to make the conversion before resizing... NO WAY
Any way to make it work ? (It is fine doing it thru XNCONVERT )
Thanks

Re: un probleme avec / problem with "-levels 1 213"

Posted: Sat Jul 29, 2017 5:03 pm
by cday
payaxnv wrote:quand j'inclus cette commande dans un BAT (avec nconvert donc) j'ai des images qui sont éclaircies (grillées, beaucoup plus que lors du traitement manuel) sur environ le 1/4 supérieur, le reste étant inchangé.
To be clear:

In XnConvert all images are converted correctly?

But in NConvert [tested in a batch file] all images, or only some images, are not converted correctly?

Could you upload an example file that doesn't convert correctly using NConvert, so that Pierre can possibly test it?

Edit:

The XnConvert Resize dialog has a setting for Enlarge/Reduce which I don't see in your code, or as an option in the NConvert help file, possibly not supported in NConvert??

I see there is the following option associated with the resize option, I don't know if it could be relevant, probably not??

Code: Select all

-resize fill w h    : Scale by filling the box wxh
Pierre?

Re: un probleme avec / problem with "-levels 1 213"

Posted: Sat Jul 29, 2017 9:35 pm
by payaxnv
thanks for your answer:
In XnConvert all images are converted correctly?
YES

But in NConvert [tested in a batch file] all images, or only some images, are not converted correctly?
NO... NONE

Could you upload an example file that doesn't convert correctly using NConvert, so that Pierre can possibly test it?
yes (ALL the images are mistreated (tested on #50 different one))

I have try before or within resizing: same wrong result :|

Code: Select all

 %nconvert_path%  -overwrite -out bmp -levels 1 213 -o img_1920_RSD_### *.jpg
 %nconvert_path%  -overwrite -out bmp  -dpi 72 -resize 1920 0 -ratio -rtype lanczos -subsampling 2 -o img_1920_RSD_### img_1920_RSD_*.bmp
or

Code: Select all

%nconvert_path% -levels 0 213 -ratio -rtype lanczos -resize shortest 1920 -out bmp -o img_1920_RSD_### *.jpg
original image (exemple)

Re: un probleme avec / problem with "-levels 1 213"

Posted: Sun Jul 30, 2017 12:45 am
by XnTriq
Could you please try the icc_ie (Ignore embedded ICC profile) option, payaxnv?

Re: un probleme avec / problem with "-levels 1 213"

Posted: Sun Jul 30, 2017 8:10 am
by payaxnv
no result (same result) with:

Code: Select all

%nconvert_path% -icc_ie -levels 0 213 -ratio -rtype lanczos -resize shortest 1920 -out bmp -o img_1920_RSD_### *.jpg
:bug: :|
I have tested in 2 steps: 1: just change levels then 2 resize...same bug
so it is in the "level" command
i try also level 1 123 instead of level 0 123 > same thing

All images have the same problem:

Re: un probleme avec / problem with "-levels 1 213"

Posted: Sun Jul 30, 2017 8:25 am
by payaxnv
PS
tested with another bunch of images from another sources > same result :bug:

Re: un probleme avec / problem with "-levels 1 213"

Posted: Sun Jul 30, 2017 8:37 am
by cday
payaxnv wrote:PS
tested with another bunch of images from another sources > same result :bug:
I think testing with a single image that shows the problem (the JPEG you posted above?) and the minimum code that produces the problem (seems to be the levels operation?) is the best way to proceed...

[I'm afraid I don't have any time today, or othe ideas immediately... :( ]

Re: un probleme avec / problem with "-levels 1 213"

Posted: Sun Jul 30, 2017 2:26 pm
by payaxnv
some info:
tested with a total of #200 images from various sources > same result
i forgot to mention that during the bat, nconvert says "ok" to each operation

most interesting: tested with -autolevels :

Code: Select all

 rem 2 operations 
 rem intermediate images are kept for debugging
 rem 1 works on levels
 %nconvert_path%  -icc_ie -overwrite -out bmp  -autolevels -o img_1920_RSD0_### *.jpg
rem 2 resize
 %nconvert_path%  -overwrite -out bmp -q 90  -dpi 72 -resize 1920 0 -ratio -rtype lanczos -subsampling 2 -o img_1920_RSD_### img_1920_RSD0_*.bmp
 
NOT the same errors
BUT mistreatment appears in large (double page) images

> seems to be insufficient buffer to work
if you agree, please contact the author of this wonderful tool

if i make a mistake, please correct me
thanks for helping

EDIT:
im not sure as before, next tests show errors also with -autolevels, about 2% of images:ex:

Re: un probleme avec / problem with "-levels 1 213"

Posted: Sun Jul 30, 2017 2:58 pm
by payaxnv
another example:

Re: un probleme avec / problem with "-levels 1 213"

Posted: Sun Jul 30, 2017 5:05 pm
by cday
I think you need to try to isolate the problem to one or two example files, and the simplest code required to reproduce the issue, so that it can be reproduced easily and investigated... :)

Re: un probleme avec / problem with "-levels 1 213"

Posted: Mon Jul 31, 2017 2:02 pm
by payaxnv
the code is in the post above :D :
in fact only the first command is interesting, second one resize (properly) an already altered image

Code: Select all

 rem 2 operations
 rem intermediate images are kept for debugging
 rem 1 works on levels
 %nconvert_path%  -icc_ie -overwrite -out bmp  -autolevels -o img_1920_RSD0_### *.jpg
rem 2 resize
 %nconvert_path%  -overwrite -out bmp -q 90  -dpi 72 -resize 1920 0 -ratio -rtype lanczos -subsampling 2 -o img_1920_RSD_### img_1920_RSD0_*.bmp
the test images are in the 2 post before :D :D

you can change

Code: Select all

-autolevels
with

Code: Select all

 -levels 1 123
or

Code: Select all

-levels 0 123
to reproduce this problem :D :D :D

Re: un probleme avec / problem with "-levels 1 213"

Posted: Wed Aug 02, 2017 11:30 am
by xnview
it's not really a bug, -autolevels work on all separate component, -autocontrast works closest as -levels

With your pictures, -autolevels doesn't work correctly

Re: un probleme avec / problem with "-levels 1 213"

Posted: Thu Aug 03, 2017 12:10 pm
by payaxnv
OK i understand,
but it s not working fixed levels (should be apply to all images) as -levels 1 123
?