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

Fit image to (edge) #798

Open
CharonM72 opened this issue Aug 20, 2022 · 0 comments
Open

Fit image to (edge) #798

CharonM72 opened this issue Aug 20, 2022 · 0 comments

Comments

@CharonM72
Copy link

CharonM72 commented Aug 20, 2022

Requesting a feature to fit the image to a specific width or height, or to fit the image within specific boundaries - in simpler terms, like in Windows etc. when setting a desktop wallpaper, there are various options to:

  • Fill: resizes the image so the entire image fits inside the specified resolution, creating empty borders on the edge that are too small
  • Fit: resizes the image so the entire image fills the specified resolution, cutting off the edges of the image that are too large
  • Stretch: I think this is already implemented in resize (resolution)
  • Tile: I think? already implemented in tile fill
  • Center: already implemented in a sense in crop (border)

This is related to #777 but it does not necessarily need to make a canvas of a different size than the image. For instance:

I have a large folder of images of various sizes. I want it to be as large as possible, without exceeding the dimensions of 3840x2160. Let's say I have one image that is 1024x1024, and another that is 1920x768.
First, I upscale the images by 4x, so the first becomes 4096x4096 and the second becomes 7680x3072.
I use this node, with the "Fit" setting. The first image is resized to 2160x2160, and the second is resized to 3840x1536. No excess canvas border would necessarily have to exist.
Now let's say I want the image to fill the whole resolution, by cutting off excess edges.
By doing the same thing with the "Fill" setting, the first image is resized to 3840x2160 (cutting off the top and bottom edges), and the second one is also resized to 3840x2160 (cutting off the left and right edges). Additionally, there could be an option to resize to those resolutions and not cutting off the edges.

Here's a visual representation of what I am thinking (a 350x321 image in a 1024x768 canvas, with GIMP, dotted red line is the canvas border):

Click to expand Fill (without cropping):

image

Fill (with cropping):
image

Fit:
image

Stretch (already implemented):
image

Tile (already implemented):
image

Center (kind of implemented?):
image

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

1 participant