Comments (7)
Ah well done! Yes I see a failure too, though only on macOS:
12:21 $ vips tiffsave k2_mono.jpg x.tif --tile --compression jpeg --Q 90
VipsJpeg: Unsupported color conversion request
VipsJpeg: Unsupported color conversion request
VipsJpeg: Unsupported color conversion request
wbuffer_write: write failed
unix error: Unknown error: -1
✘-1 ~/pics
At a guess, Q>=90 is disabling chroma subsampling, and the very recent libtiff on macOS doesn't like this for greyscale images. I'll investigate.
from libvips.
Yes, mozjpeg seems to be missing some of the colourspace conversions that the other libjpeg implementations support. I've changed the way libvips disables chroma subsample for tiff jpeg write and it seems to work now.
This fix will be in 8.15.2, thanks for the report!
from libvips.
Hi @cavenel,
It's working for me:
16:13 $ vips tiffsave k2.jpg x.tif --tile --compression jpeg --Q 90
✔ ~/pics
16:14 $ which vips
/opt/homebrew/bin/vips
✔ ~/pics
16:14 $ vips --version
vips-8.15.1
✔ ~/pics
16:14 $
That's an M2 mac mini with homebrew libvips.
Could you perhaps have a non-RGB image in input.tif
? You can only save RGB and mono images with JPEG compression.
from libvips.
Hi @jcupitt,
That is strange, I tried with multiple input files, including jpeg input files (so RGB).
And the fact that it works with a different compression value (like --Q 85
) is also confusing.
I will investigate more with other images tomorrow, and share one that fails.
from libvips.
Yes, that is puzzling! That was with brew update && brew upgrade
as of an hour ago, if that makes a difference.
from libvips.
So, after some more testing, it seems like it only fails on grayscale images.
Take any image, open in GIMP, change mode to Grayscale and export as PNG or JPG. Then vips will fail to convert it to tiff with tile and compression bigger or equal to 90.
Here is an example of image that fails:
With the command:
vips tiffsave k2_g.jpg x.tif --tile --compression jpeg --Q 90
from libvips.
After some digging, it seems it's mozjpeg that's causing the problem. Here's a dockerfile that fails in the same way on ubuntu 23.20:
https://github.com/jcupitt/docker-builds/tree/master/libvips-mozjpeg-ubuntu23.10
I'll poke a bit more.
from libvips.
Related Issues (20)
- Conversion to PFM gives incorrect output HOT 2
- Improve `tilecache` performance
- JXL Support in Libvips Web Build HOT 3
- vips: unknown action "dzsave", vips-8.15.1 on Gentoo HOT 1
- Row sums from vips_project do not necessarily give the same value like summing img(i,j) along i HOT 2
- Looks like 8.15.2 tag is wrong? HOT 1
- vips 8.15.2 failed to build with latest xcode HOT 11
- HDR AVIF to HEIC (hdr) HOT 4
- Feature request: Support SDR→HDR via RTX HDR (upmapping / inverse tone mapping)
- AVIF with bitdepth 10 or 12 crashes
- Add nclx->icc colour management to heifload HOT 24
- Segmentation fault when performing very large number of operations HOT 1
- Subsample mode not working with jpegli HOT 4
- Add target write to `rawsave` HOT 2
- Cannot link to proper libraries on Windows 11 Pro. HOT 1
- Thumbnail/Resize removes color on Alpine HOT 1
- Add support for fractional tiff values (eg. 10 or 12 bits per pixel) HOT 6
- Include JXL as Foreign TIFF Compression HOT 3
- The position of "#include <vips/vips8>" matters. HOT 2
- distance transform HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libvips.