Skip to content

[enhancement]: Image resizing algorithm in layer transform #8004

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

Closed
1 task done
DustyShoe opened this issue May 13, 2025 · 1 comment · Fixed by #8057
Closed
1 task done

[enhancement]: Image resizing algorithm in layer transform #8004

DustyShoe opened this issue May 13, 2025 · 1 comment · Fixed by #8057
Labels
enhancement New feature or request

Comments

@DustyShoe
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Contact Details

No response

What should this feature add?

Is it possible to implement image resizing algorithm (like bicubic, lanczos, etc.) to layer transformation?
The reason i'm asking is, that there is significant image degradation when sizing down image containing thin lines like lineart or contour images for CN. The option could be in drop down menu in transfor dialog window where you can choose to apply algorithm or not if it is desirable.

Here's an example:
First is original image. Second is sized down in canvas with transform vs with resize image node in editor using lanczos algorithm.

Image

Image

Alternatives

No response

Additional Content

No response

@DustyShoe DustyShoe added the enhancement New feature or request label May 13, 2025
@psychedelicious
Copy link
Collaborator

In Canvas, resizing a layer uses the browser's built-in HTMLCanvas API. We don't have much control over it.

We could explore previewing the transformation on the canvas, then sending the transformation matrix to the backend to resize with a higher quality resizing algorithm. I haven't tried this but in theory it should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants