A client has given me a collection of JPEG images which he would like to be incorporated into some visuals.
Some images are very wide, perhaps having a 3:1 aspect ratio.
I tried using the JpegFolder, but many images are severely cropped at the sides as the JpegFolder module is always filling the height of the Magic window.
How about a "Scale to Fit" option that would automatically scale the entire image to just fit in the Magic window, regardless of whether width or height is limiting?
Likewise, "Scale to Fit" would be useful in the Image module.
In the meantime, any suggestions of how to cycle through the images, fully showing each one as large as possible?
"Scale to Fit" option for JpegFolder module
-
- Posts: 712
- Joined: Sun Sep 14, 2014 8:15 am
- Location: UK
- Contact:
Re: "Scale to Fit" option for JpegFolder module
Funny you should request those things. I just added a "Stretch" parameter to all the Media modules. It will be available in the next release.
-
- Posts: 712
- Joined: Sun Sep 14, 2014 8:15 am
- Location: UK
- Contact:
Re: "Scale to Fit" option for JpegFolder module
Cool, , but from its name I'm wondering about the exact functionality of the new parameter.Eric wrote:...I just added a "Stretch" parameter to all the Media modules...
For my application in some cases a "shrink-to-fit" might be needed in order to fit the limiting dimension of the input image, but in other cases a "stretch-to-fit". Either way, the amount of stretch or shrink would be a changing function of the image size and shape with respect to the Magic Window.
For what I need a "Scale to fit" checkbox would be needed, rather than a parameter.
Re: "Scale to Fit" option for JpegFolder module
Yes, that's the way it works. It stretches if it's too small, or squashes if it's too big. But "Stretch/squash" is too long for a parameter name; I like to keep it short and then have more info in the tooltip/help.For my application in some cases a "shrink-to-fit" might be needed in order to fit the limiting dimension of the input image, but in other cases a "stretch-to-fit". Either way, the amount of stretch or shrink would be a changing function of the image size and shape with respect to the Magic Window.
It depends on who you ask, but "Fit" and "Shrink" usually mean to preserve the aspect ratio, which is not what you want. The Incredible Shrinking Man, for example, has the same proportions when he is small. https://en.wikipedia.org/wiki/The_Incre ... inking_Man . Or if some item "fits" in a box, it usually doesn't mean all dimensions of the item are exactly proportionate to the box, although it can mean that sometimes.
In Magic, a checkbox is a type of parameter. Every line in a module is a parameter, with different types: drop-down box; checkbox; trigger button; text box; etc. Further, some parameters (such as text boxes) can have additional sub-types, such as numbers (1.234) vs strings (Hello). https://magicmusicvisuals.com/downloads ... ParametersFor what I need a "Scale to fit" checkbox would be needed, rather than a parameter.
-
- Posts: 712
- Joined: Sun Sep 14, 2014 8:15 am
- Location: UK
- Contact:
Re: "Scale to Fit" option for JpegFolder module
Thanks for the explanations .
I shall attempt to be more precise.
I would expect black bars at either at the sides, or above & below the resultant image, if the source image aspect ratio did not exactly match that of the Magic Window.
How about "Fit" to describe this with the same zoom factor X & Y, and "Fill" as an alternative with X and Y zoomed independently to avoid any black bars.
A checkbox parameter called "Stretch" would have an associated drop-down box to select "Fit" or "Fill".
I shall attempt to be more precise.
Preserving the aspect ratio of the input image is exactly what I want. The images I wish to display includes photos of vinyl disks and their square sleeves. These must not be distorted.Eric wrote:...It depends on who you ask, but "Fit" and "Shrink" usually mean to preserve the aspect ratio, which is not what you want...
I would expect black bars at either at the sides, or above & below the resultant image, if the source image aspect ratio did not exactly match that of the Magic Window.
How about "Fit" to describe this with the same zoom factor X & Y, and "Fill" as an alternative with X and Y zoomed independently to avoid any black bars.
A checkbox parameter called "Stretch" would have an associated drop-down box to select "Fit" or "Fill".
Re: "Scale to Fit" option for JpegFolder module
Ok I understand now, thanks. Perhaps a drop-down box would be a reasonable solution then.
-
- Posts: 712
- Joined: Sun Sep 14, 2014 8:15 am
- Location: UK
- Contact:
Re: "Scale to Fit" option for JpegFolder module
Many thanks Eric!
-
- Posts: 176
- Joined: Tue Aug 26, 2014 11:22 am
Re: "Scale to Fit" option for JpegFolder module
very interesting, all these features could be very useful, nice idea !