harvard-lts / kakadu-vips

Kakadu JP2 reader and writer for libvips
Apache License 2.0
3 stars 0 forks source link

Test image formats #11

Closed scossu closed 5 months ago

scossu commented 5 months ago

@jcupitt I'm putting together a set of test samples according to the TODO list in the README. I have a couple of questions:

kakadu does not seem to support icc profile save

What are our options here? Can vips internally extract the ICC profile and re-add it to the converted image?

16 bit and float images should work, but need testing

I will provide these formats.

alpha images should work, but need testing

I will provide a sample.

cmyk, lab and greyscale should work, but need testing

I am not sure how to generate a LAB or CMYK image from RGB. Does it involve creating an intermediary XYZ image?

palettised images should work, but need testing

I will provide a sample.

chroma subsampling should work, but needs testing

Do you mean a YUV fomat image? I am not sure about how to generate a sample for this either.

multispectral images should work, but need testing

I will ask my Imaging department. AFAIK this depends on the digitization device.

jcupitt commented 5 months ago

Hello again,

I had another look and the example kakadu code has been updated to include profile save. I've added this feature and a test. You can write eg.:

$ vips kakadusave wtc.jpg x.jp2 --profile srgb

And it'll save the image, attaching the standard srgb profile. You can use a filename there to attach some other profile. Without that it'll write with any profile from the source image.

jcupitt commented 5 months ago

I think samples of the main jp2k image types you need to handle for your workflow would be enough for now. We can check more exotic formats later.

scossu commented 5 months ago

Wonderful. Thanks. I'll test that if you open a PR.

Agreed on scope. No need to test 32-bit floats or non-RGB interpretations as RGB8 or RGB16 should be the only allowed format for our production masters.

jcupitt commented 5 months ago

It was a simple thing so I pushed icc profile write to master. If you build that, you can test it.

(maybe I hsould have made a PR)

scossu commented 5 months ago

Verified, it works now.