Tags: patch Hi, While trying to speed up "emacs as an image viewer", I found that emacs is using libjpeg with color quantization and it seems that removing this quantization could speed up JPEG loading a bit. My simple limited benchmark: - M-: (clear-image-cache) - Open an image in folder with some large enough pictures in it (4000x3000 here) - M-: (benchmark-run 10 (image-next-file 1)) Here are the results I get: without this path: (5.415405491 1 0.09232176400000025) with: (3.079911418 1 0.0751190459999993) I don't think that this patch could be applied as is (it is rather ugly). And I also think that I probably have missed some (many?) use case (where color quantization is mandatory). But I'm submitting this patch anyway as a conversation starter on the subject. Thanks, In GNU Emacs 31.0.50 (build 9, x86_64-unknown-openbsd7.6, X toolkit) of 2024-11-22 built on computer Repository revision: c66c0942ea9ac10e6d6324e472150de403a03b69 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101014 System Description: OpenBSD computer 7.6 GENERIC.MP#437 amd64 Configured using: 'configure CC=egcc CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib MAKEINFO=gmakeinfo --prefix=/home/manuel/emacs --bindir=/home/manuel/bin --with-x-toolkit=lucid --with-toolkit-scroll-bars=no --without-cairo --without-compress-install'