image 'stretch' but maintaining aspect ratio

1,253 views
Skip to first unread message

JACanterbury

unread,
Dec 8, 2011, 5:46:56 AM12/8/11
to E-Prime
Hi all,

My research indicates that the answer to my question is 'No' but I
thought I'd try a quick post incase someone has found a way to do
this.

I want to display images without altering the aspect ratio (ie width
to height proportions) but to fix one of the dimensions, e.g. height
and leave eprime to set the appropriate width so that the image
doesn't get stretched/squashed. (easy in css but I haven't seen how it
can be done in eprime)

Any thoughts?

Many thanks,

John

Michiel Spape

unread,
Dec 8, 2011, 6:23:00 AM12/8/11
to e-p...@googlegroups.com
Hi,
E-Prime is, of course, not quite as convenient as current web-standards, but I see no reason it should be _that_ difficult to arrange. That is, if your images all need to be 500 pixels high, say, and your picture is 200x400, can't you just stretch it by 25% (i.e. width and height become 500/400=125%, or 250x500)? The only thing required is that you need to know the base size of your pictures prior to the stretching operations.
Two points, however: E-Prime stretches incredibly badly, it does no form of anti-aliasing whatsoever, so your pictures will become degraded in quality. A lot. Secondly, on that point, and given that it's still science-related, I think it is much better practise to do such things off-line (in photoshop or whatever) - keeping the quality somewhat high and knowing full well in advance what you're going to get. It's a bit of work, but well worth it, generally.
Cheers,
Mich

Dr. Michiel M. Sovijärvi-Spapé
Research Fellow
Perception & Action group
University of Nottingham
School of Psychology
www.cognitology.eu

Hi all,

Any thoughts?

Many thanks,

John

--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-p...@googlegroups.com.
To unsubscribe from this group, send email to e-prime+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

ben robinson

unread,
Dec 8, 2011, 9:13:47 AM12/8/11
to e-p...@googlegroups.com
michael's probably got the better suggestion, but i have done this in eprime.
it requires, as he said, knowing the base size of the pictures. find
this info by right clicking on each of your picture's icons in
windows, selecting properties, and then entering the horizontal and
vertical pixel information into a List object in eprime.
unfortunately, i know of no way to do this but by hand.
next you would set your SlideImage object's y-resolution to be a fixed
value, say 500 pixels high, and its x-resolution to be [(the original
y-res) divided by 500 multiplied by (the original x-res)].

ben

David McFarlane

unread,
Dec 8, 2011, 10:47:16 AM12/8/11
to e-p...@googlegroups.com
John,

About the lack of anti-aliasing during
stretching... I have never found this to be a
problem, but that is because I always start with
original images at a higher resolution and then
use "Stretch" to effectively "Shrink" the
original image, which seems to work OK.

That said, I too think it better to just make the
orginal images at the size you want displayed,
and then just let E-Prime display those without
Stretch. I like to reserve Stretch just for
doing crude animations where I have to manipulate
the image size at run time (although I might also
use Stretch at times just to be lazy).

-- David McFarlane

Michiel Spape

unread,
Dec 8, 2011, 11:10:49 AM12/8/11
to e-p...@googlegroups.com
Hi David et al.,

Just a note - be careful, just because you're stretching from higher to lower resolution doesn't mean it gets to be okay. For instance, let's say you have 2 black pixels, 1 white pixel, 3 blue pixels horizontally, next to one another. You want to decrease size by 50%. There will be 1 black pixel to start with, for sure, but what happens with the rest? Your screen doesn't do half pixels, and although anti-aliasing blurs it in such a way that this isn't too obvious, E-Prime (unless 2.0 changed this) doesn't do that. So, what you get is exactly the same as what you get in MSPaint, by decreasing size of this image. I just tested it, the outcome is 1 black pixel, 0 white pixels, and 2 blue pixels. Why is the 0.5 white pixel rounded down (to 0), but the 1.5 blue pixels are rounded up? (to 2) Beats me. A better coder could give the answer, presumably. Anyway, given a high resolution, these changes may not be immediately noticeable, although - if you're a webcoder - you might've seen the effect of what happens with people who present a huge picture with an img tag saying <img width = "20%">. Ugliness and high server load ensues. As a result, I've always tried telling my students they should process stimulus material as well as possible - and if doing that outside e-prime is more work, then so be it.
Cheers,
Mich

PS: This is me signing off - I'll be back next year, working on a new post doc position over at the Helsinki Institute for Information Technology.

John,

-- David McFarlane

--

Reply all
Reply to author
Forward
0 new messages