Closed T8RIN closed 1 year ago
I have no sense why this happens, it's l ooks like the only lossless/lossy type affects image and distance are ignored
This is just one possible options currently to regulate quality
. I had a look to source for well-known ImageMagick
and it just do not provide any options to regulate quality except loosy
/loseless
. This may happen due to libjxl
still in beta, and after some time ( possible few years ) if demand to JXL will increase it will start works as expected
I have no sense why this happens, it's l ooks like the only lossless/lossy type affects image and distance are ignored
This is just one possible options currently to regulate
quality
. I had a look to source for well-knownImageMagick
and it just do not provide any options to regulate quality exceptloosy
/loseless
. This may happen due tolibjxl
still in beta, and after some time ( possible few years ) if demand to JXL will increase it will start works as expected
Hmmm, sounds not good, but maybe for the users there will be no sense , btw thanks for the library :)
I will use another product flavor to not increase my app size five/six times
@awxkee sorry for asking this, but do you now the way of writing exif metadata to files except of JPG/PNG/WEBP ? Because google don't want to add such functionality to ExifInterface yet
@awxkee sorry for asking this, but do you now the way of writing exif metadata to files except of JPG/PNG/WEBP ? Because google don't want to add such functionality to ExifInterface yet
Yes, almost all libraries provides native interface to do this. Google just decided not implement this in android.
@awxkee sorry for asking this, but do you now the way of writing exif metadata to files except of JPG/PNG/WEBP ? Because google don't want to add such functionality to ExifInterface yet
Yes, almost all libraries provides native interface to do this. Google just decided not implement this in android.
Which libraries for example?
@awxkee sorry for asking this, but do you now the way of writing exif metadata to files except of JPG/PNG/WEBP ? Because google don't want to add such functionality to ExifInterface yet
Yes, almost all libraries provides native interface to do this. Google just decided not implement this in android.
Which libraries for example?
Libavif, libavif definitely do
Finally I had a look and a distance parameter works perfectly but this required quite complex computation for distance
static inline float JXLGetDistance(int quality) { if (quality == 0) return (1.0f); if (quality >= 30) return std::clamp((0.1f + (float) (100 - std::min(100.0f, (float)quality)) * 0.09f), 0.0f, 15.0f); return std::clamp((6.24f + (float) pow(2.5f, (30.0 - (float) quality) / 5.0) / 6.25f), 0.0f, 15.0f); }
So I did it and added just a quality
parameter which works just in range 0...100 where 0 means default parameter equals to distance
= 1.0f
So finally there are two quality parameters in Jpeg XL quality and effort that works simultanesously
Finally I had a look and a distance parameter works perfectly but this required quite complex computation for distance
static inline float JXLGetDistance(int quality) { if (quality == 0) return (1.0f); if (quality >= 30) return std::clamp((0.1f + (float) (100 - std::min(100.0f, (float)quality)) * 0.09f), 0.0f, 15.0f); return std::clamp((6.24f + (float) pow(2.5f, (30.0 - (float) quality) / 5.0) / 6.25f), 0.0f, 15.0f); }
So I did it and added just aquality
parameter which works just in range 0...100 where 0 means default parameter equals todistance
= 1.0f
So it means i can use both effort and quality for lossless and lossy modes?
I’m not really tested this one but I think you can. However I think setting a quality in lossless mode will be ignored by libjxl, but I didn’t check it
Okay 👀
I have no sense why this happens, it's l ooks like the only lossless/lossy type affects image and distance are ignored