I can't make my mind up on this one. It's right on the threshold of my
you know how I hate adding things that will confuse newbies. Is this a
On 23/01/2014 02:11, Michael MacAskill wrote:
> Hi Jonas,
>
> That is pretty cool, for the more anally-retentive of us who don't like submitting lo-res images amongst our much higher quality figures.
>
> I guess it handles it OK when the window also contains stimuli that aren't inherently vector-based, like Gabor patches, bitmap images, etc?
>
> Cheers,
>
> Mike
>
> On 22 Jan, 2014, at 03:31, Jonas Kubilius<
qbi...@gmail.com> wrote:
>
>> Hey all,
>>
>> Recently I wanted to get a screen capture of stimuli for my paper. Since I needed high resolution images, the usual getMovieFrame did not help. Since my stimuli were simple shapes, I decided to convert everything to an svg file and enjoy the precision of vector graphics. I've implemented it in the most recent version of psychopy_ext using svgwrite for most shape stimuli and also a text stimulus.
>>
>> But perhaps this feature would be useful for all psychopy users? I can see several use cases where SVG output would be preferred over the usual images:
>> • High quality
>> • Ability to manipulate figures, such as getting rid of certain shapes or copy them to data plots
>> • Web-oriented so might find unexpected uses (e.g., ideal for JS-based presentations)
>> If there is an interest in this, I think the following changes to psychopy would be required:
>> • Add a canvas argument in visual.Window:
>> • If canvas is None, nothing is exported.
>> • If canvas is png, jpg etc, getMovieFrame is used.
>> • If canvas is svg, exporting to svg is performed during draw() such that object properties would be recorded even if a user is reusing the same object to draw a frame.
>> • Add to_svg() method to all stimuli.
>> • Add svgwrite to dependencies.
>> Here is window capture (please ignore gray lines on the disk; must be some problems with my drivers):
>>
>>
>>
>> And here is the currently implemented conversion to SVG in psychopy_ext:
>>
>>
>>
>> Looks quite good already except for the vertical text positioning (I'm not sure how to get the correct text height -- stim.height or stim.heightPix do not report the actual size for some reason). Also, text wrapping will probably be too difficult to implement until SVG 2.0 becomes mainstream.
--
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.
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.