Previous topicNext topic

"Scale to Fit" option for JpegFolder module

Suggestions for new features for Magic.
Post Reply
Terry Payman
Posts: 710
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

"Scale to Fit" option for JpegFolder module

Post by Terry Payman »

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?
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: "Scale to Fit" option for JpegFolder module

Post by Magic »

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.
Terry Payman
Posts: 710
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: "Scale to Fit" option for JpegFolder module

Post by Terry Payman »

Eric wrote:...I just added a "Stretch" parameter to all the Media modules...
Cool, :D :D :D, but from its name I'm wondering about the exact functionality of the new parameter.

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.
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: "Scale to Fit" option for JpegFolder module

Post by Magic »

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.
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.

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.
For what I need a "Scale to fit" checkbox would be needed, rather than a parameter.
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 ... Parameters
Terry Payman
Posts: 710
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: "Scale to Fit" option for JpegFolder module

Post by Terry Payman »

Thanks for the explanations :D .
I shall attempt to be more precise.
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...
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.

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".
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: "Scale to Fit" option for JpegFolder module

Post by Magic »

Ok I understand now, thanks. Perhaps a drop-down box would be a reasonable solution then.
Terry Payman
Posts: 710
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: "Scale to Fit" option for JpegFolder module

Post by Terry Payman »

:D :D :D Many thanks Eric! :D :D :D
damstraversaz
Posts: 176
Joined: Tue Aug 26, 2014 11:22 am

Re: "Scale to Fit" option for JpegFolder module

Post by damstraversaz »

very interesting, all these features could be very useful, nice idea !
Post Reply