Please add dither for reading JPEG files

Ask for help and post your question on how to use XnView MP.

Moderators: helmut, XnTriq, xnview

User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Please add dither for reading JPEG files

Post by XnTriq »

Thanks, user0!

So it's also not about the Zoom on HiDPI screen: 1 image pixel equals 1 screen pixel in ToolsSettings…View?
User avatar
user0
XnThusiast
Posts: 2411
Joined: Sat May 09, 2015 9:37 am

Re: Please add dither for reading JPEG files

Post by user0 »

nope
'Zoom on HiDPI screen' has no enhancements
at 100% win dpi scale - it has no effect
at 150% win dpi scale - it upscales image by 1.5, result should be the same as zoom-in to 150% w/o filter when this setting is off
Xn User
Posts: 227
Joined: Sat Jan 05, 2019 1:16 pm

Re: Please add dither for reading JPEG files

Post by Xn User »

XnTriq wrote: Sun Feb 16, 2025 5:15 am I'm afraid I don't understand what this request is about.
To my knowledge, dithering is used to prevent color banding and to improve (perceived) image quality during reduction of color depth.
If an image with a color depth greater than true color (= 24 bits = 8 bits per channel) is opened in XnView, there's a message:
This picture will be converted to RGB with 8bits per component
I don't know which method is used to reduce the color in this case.
Now I explain
When use subsampling 1x1 1x1 1x1 dithering not need , but if in file usesubsampling 1x2 1x1 1x1 or subsampling 2x1 1x1 1x1 or subsampling 2x2 1x1 1x1 , so need dithering , also because what color space smaller when 24 bit , subsampling 1x2 or 2x1 or 2x2 reduces real color depth and in this need use dither , roughly speaking if we use formula all with 1x1 1x1 1x1 , use true 24 bit color depth , but if we use 1x2 1x1 1x1 or 2x1 1x1 1x1 or 2x2 1x1 1x1 or any - we uselower color depth 18 bit , 16 bit , 15 bit and next , but not 24 bit.
Also , about ACDSee , you test version free and next plugin ide_acdstd.apl lower quality for correct test , you need use ACDSee Pro andwithout QuickView mode

Image

here very good show so about i say because so working formula 1x2 or 2x1 or 2x2 somewhere
Xn User
Posts: 227
Joined: Sat Jan 05, 2019 1:16 pm

Re: Please add dither for reading JPEG files

Post by Xn User »

I sure what I right , you can compare files here https://www.mediafire.com/folder/gf051u ... ality+next , then you see what files 1x1 always coincide and if compare files 1x2 or 2x1 you can see what files not coincide
User avatar
user0
XnThusiast
Posts: 2411
Joined: Sat May 09, 2015 9:37 am

Re: Please add dither for reading JPEG files

Post by user0 »

omfg.. are you █████?
your ACDSee 5 produces incorrect results after you replaced default lib (v1.3.4) with a newer one (but not the latest).

0. forget about XnView
1. install ACDSee 2025
2. do same exports
3. compare with your ACDSee 5 exports
4. admit the truth, do not mess with apps and do not use ancient stuff anymore
Last edited by XnTriq on Sun Feb 16, 2025 10:45 pm, edited 1 time in total.
Reason: https://newsgroup.xnview.com/viewtopic.php?t=75
Xn User
Posts: 227
Joined: Sat Jan 05, 2019 1:16 pm

Re: Please add dither for reading JPEG files

Post by Xn User »

0) I like XnView MP and that's why I want help do this viewer better , so good how much it will turn out
1) ACDSee 2025 me not like , slow and big program with worst work with file format WEBP , AVIF , there this formats saving with lossy always
2) in version home , not pro , apl work worse
3) and what ? If developer do worse plugin , this not mean , what this right
4) what for ? If you think so , maybe rollback all fixes with AVIF and HEIC ? What for improve application ? Work as is and good , right ?
here subtract files https://www.mediafire.com/file/tp0gy3vs ... t.avi/file you can compare results
Just with a stacked approach can return all bugs to XnView MP )))))
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Please add dither for reading JPEG files

Post by XnTriq »

By default, XnView MP uses IJG's libjpeg for encoding, decoding, and recoding/transcoding.
Starting with v1.8.6, we can Use JPEG-li in ToolsSettings…FormatsWriteJPEG. (Thank you, Pierre!)

djpeg is the official command-line application for decoding JPEGs.
https://www.ijg.org/files/jpegsr9f.zip → usage.txt → DJPEG DETAILS wrote:-fast Select recommended processing options for fast, low quality output. (The default options are chosen for highest quality output.) Currently, this is equivalent to "-dct fast -nosmooth -onepass -dither ordered".
[…]
Switches for advanced users:
[…]
-dither fs Use Floyd-Steinberg dithering in color quantization.
-dither ordered Use ordered dithering in color quantization.
-dither none Do not use dithering in color quantization.
By default, Floyd-Steinberg dithering is applied when quantizing colors; this is slow but usually produces the best results. Ordered dither is a compromise between speed and quality; no dithering is fast but usually looks awful. Note that these switches have no effect unless color quantization is being done. Ordered dither is only available in -onepass mode.
https://www.ijg.org/files/jpegsr9f.zip → usage.txt → HINTS FOR DJPEG wrote:"-dct fast" and/or "-nosmooth" gain speed at a small sacrifice in quality.
When producing a color-quantized image, "-onepass -dither ordered" is fast but much lower quality than the default behavior. "-dither none" may give acceptable results in two-pass mode, but is seldom tolerable in one-pass mode.
@Pierre: Which parameters are used by XnView for loading JPEGs :?:
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Please add dither for reading JPEG files

Post by XnTriq »

Interesting discussion on GitHub for JPEG XL: Subpar decoding for transcoded jpegs
Xn User
Posts: 227
Joined: Sat Jan 05, 2019 1:16 pm

Re: Please add dither for reading JPEG files

Post by Xn User »

I can not understanding , why in this topic we say about process ENCODING , I all topic try sayd about DECODING process and this settings in XnView MP absent , I can not set as need decoding JPEG , I can set as encoding to JPEG , but I con not set as decoding from JPEG to any other format , why so ?
I'm realy can not understanding why so.
Xn User
Posts: 227
Joined: Sat Jan 05, 2019 1:16 pm

Re: Please add dither for reading JPEG files

Post by Xn User »

I ask do as here , why this so hard do ?
Simply add tab with settings as reading JPEG , with dither or without dither , and if with dither then level and method as do dithering , this will can improve XnView
Attachments
ditherjpeg.png
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Please add dither for reading JPEG files

Post by XnTriq »

I mentioned the write/encode setting for Jpegli hoping that Piere might consider a similar option for reading/decoding.
We have to wait for his response.
Xn User
Posts: 227
Joined: Sat Jan 05, 2019 1:16 pm

Re: Please add dither for reading JPEG files

Post by Xn User »

XnTriq wrote: Mon Feb 17, 2025 12:45 am I mentioned the write/encode setting for Jpegli hoping that Piere might consider a similar option for reading/decoding.
We have to wait for his response.
Thank you )
By the way , if do based "Floyd-Steinberg dithering " for High color and True color me this fully suitable ) because quality good )
So you can simply copy dithering method from Change Color Depth to options for decoding JPEG
User avatar
xnview
Author of XnView
Posts: 46235
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Please add dither for reading JPEG files

Post by xnview »

XnTriq wrote: Sun Feb 16, 2025 10:30 pm By default, XnView MP uses IJG's libjpeg for encoding, decoding, and recoding/transcoding.
Starting with v1.8.6, we can Use JPEG-li in ToolsSettings…FormatsWriteJPEG. (Thank you, Pierre!)

djpeg is the official command-line application for decoding JPEGs.
https://www.ijg.org/files/jpegsr9f.zip → usage.txt → DJPEG DETAILS wrote:-fast Select recommended processing options for fast, low quality output. (The default options are chosen for highest quality output.) Currently, this is equivalent to "-dct fast -nosmooth -onepass -dither ordered".
[…]
Switches for advanced users:
[…]
-dither fs Use Floyd-Steinberg dithering in color quantization.
-dither ordered Use ordered dithering in color quantization.
-dither none Do not use dithering in color quantization.
By default, Floyd-Steinberg dithering is applied when quantizing colors; this is slow but usually produces the best results. Ordered dither is a compromise between speed and quality; no dithering is fast but usually looks awful. Note that these switches have no effect unless color quantization is being done. Ordered dither is only available in -onepass mode.
https://www.ijg.org/files/jpegsr9f.zip → usage.txt → HINTS FOR DJPEG wrote:"-dct fast" and/or "-nosmooth" gain speed at a small sacrifice in quality.
When producing a color-quantized image, "-onepass -dither ordered" is fast but much lower quality than the default behavior. "-dither none" may give acceptable results in two-pass mode, but is seldom tolerable in one-pass mode.
@Pierre: Which parameters are used by XnView for loading JPEGs :?:
I use -dither fs & -dct fast
Pierre.
Xn User
Posts: 227
Joined: Sat Jan 05, 2019 1:16 pm

Re: Please add dither for reading JPEG files

Post by Xn User »

xnview wrote: Mon Feb 17, 2025 8:54 am I use -dither fs & -dct fast
But where ? For Encode or for decode ? I here sayding about files decoding process , you as I see sayding about files encoding process

That's why I asking you add this for decoding optionaly
User avatar
xnview
Author of XnView
Posts: 46235
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Please add dither for reading JPEG files

Post by xnview »

Xn User wrote: Mon Feb 17, 2025 9:44 am
xnview wrote: Mon Feb 17, 2025 8:54 am I use -dither fs & -dct fast
But where ? For Encode or for decode ? I here sayding about files decoding process , you as I see sayding about files encoding process
for decoding
Pierre.
Post Reply