Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced Bit-Depth Support and Error Handling for adjustColor #705

Open
stephane-archer opened this issue Jan 2, 2025 · 5 comments
Open

Comments

@stephane-archer
Copy link

Screenshot 2025-01-02 at 20 34 17 Screenshot 2025-01-02 at 20 34 50 Screenshot 2025-01-02 at 20 34 41 Screenshot 2025-01-02 at 20 34 36 Screenshot 2025-01-02 at 20 34 31 Screenshot 2025-01-02 at 20 34 25

test images:
testHorizontal.tiff.zip

@stephane-archer
Copy link
Author

if I transform the image into a regular jpeg, i don't see strange colors, so this seems to be related to tiff decoding.

@stephane-archer stephane-archer changed the title strange exposure with value between 0 and 1 strange exposure with value between 0 and 1 on Tiff Jan 2, 2025
@brendan-duncan
Copy link
Owner

The adjustColor function isn't handling 16-bit images, so for now you can make sure the image is 8-bit:

final editedImage = adjustColor(
  image.convert(format: Format.uint8),
  exposure: 0.5
);

@stephane-archer
Copy link
Author

Converting to 8-bit resolves the immediate issue, but adding native support for 10-bit, 12-bit, and 16-bit image adjustments would greatly enhance the library's usability and flexibility for modern workflows.

Currently, the library's silent handling of higher bit-depth images by returning incorrect values can lead to subtle bugs that are difficult to track down. Instead, the library should fail gracefully by throwing a clear exception when an unsupported bit depth is used with adjustColor. This approach would allow developers to identify the limitation immediately and handle it appropriately.

Implementing this change would not only improve the robustness of the library but also set a clear path for potential future enhancements that support higher bit-depth operations. It could be a significant improvement for developers working with high-fidelity image processing tasks.

@stephane-archer stephane-archer changed the title strange exposure with value between 0 and 1 on Tiff Enhanced Bit-Depth Support and Error Handling for adjustColor Jan 6, 2025
@brendan-duncan
Copy link
Owner

I pushed the fix for adjustColor. I'll still look into seeing if the different filters can be improved.

@brendan-duncan
Copy link
Owner

I pushed some changes to hue and saturation in the adjustColor function, to make the adjustments in HSV space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants