Vector images?

Mark Waddingham mark at livecode.com
Wed Oct 21 05:48:02 EDT 2015


On 2015-10-21 10:54, Richmond wrote:
> I am not confusing anything: I know you can manage "the underlying
> ability to import and render SVG",
> and I am hoping you will expose that to the end-user via the menu for
> image import that is already in place in the GUI.

Indeed - I can definitely say we will do that... We just need to figure 
out the best approach internally for that to be done :)

> Well, vector images are very widely used, and they do have the
> advantage over bitmapped ones in that they don't go "all fuzzy"
> when they are resized: that, at the very least, is a big plus, and IF
> (??????) the Geometry Manager is 'whatever' vector images
> would sit very nicely with that.

True - but there are dragons here. One might ask the question why Apple 
(with all its power, money and technical ability) requires App writers 
to make several images at different resolutions in order to make sure 
things 'dont go fuzzy' on Retina and other high resolution displays. 
They certainly have the where-with-all to implement an SVG rendering 
library - like they have done with PDF - available to 
C/C++/Objective-C/Swift - and yet they have not.

The only reasonable answer I can come up with (beyond general 
intransigence of a behemoth) is that SVG is expensive (time wise) to 
render. Far more expensive than scaling and rendering a pre-computed 
image.

Now for situations where you are always scaling / transforming and 
manipulating your content then this consideration probably largely goes 
away (although be prepared for complex SVG not to animate particularly 
well on lower end hardware). However, for the most common situation of 
icons the balance still probably largely falls towards pre-rendered 
images being better.

Ultimately, I'm definitely in the 'simplify things for the app writer' 
by way of - let's not make them have to fiddle with PhotoShop or other 
tools to generate the icons to make things look nice for the simple 
reason that the ability to easily render and snapshot SVG in LiveCode 
will mean that an easy script-based solution could always be come up 
with to solve any performance issues, at least until such a point the 
engine or standalone builder becomes 'clever' enough to do it for you.

>> LiveCode is good at processing text, so certainly export of SVG is 
>> something which can be done quite happily, and well (and indeed quite 
>> sensibly) in script. Indeed, there is even an SVG importer which has 
>> been around for a long time (although it is slightly limited by some 
>> restrictions on the LiveCode graphic object) also written in script.
> 
> Alejandro . . .

Indeed - that library was the one which was on my mind. Actually, the 
first task I set Ian (one of our engineers) to do when he first joined 
was to first write something which converted a simple language I had 
designed ('SVGL') into vector graphic objects; and then write an SVG -> 
SVGL converter. (My ideas for the much prophesized 'shape' object go way 
way back). The reason for this was that his first task after getting to 
grips with these ideas was implementing gradient fills in the graphic 
object - back when there was no existing third-party library we could 
leverage to do so (due to commercial licensing requirements).

>> Similarly, an 'export snapshot ... as svg' command would also be 
>> useful to solve specific problems for specific domains but, again, 
>> isn't going to do so for everyone.
> 
> Well, we all know what attempting to keep everybody happy at the same
> time results in: something that makes most people fed up.

True - balancing acts are always prone to the occasional 'wobble'.

> I still feel that Vector graphibs should be automatically "in the
> list": SuperCard seems to cope with them, and has for quite some time.

It always has been really - but there are various technical challenges 
involved with it.

I suspect SuperCards 'vector graphics' support is Mac PICTs or similar 
(I could be wrong). Given that SuperCard is single-platform, they have 
the luxury of being able to use whatever their target platform (Mac) 
supports. We, unfortunately, do not have the same amount of flexibility.

> But they are as entitled to bang-on about what they would like just as
> much as I am entitled to bang on about graphics.

I can't argue with that :)

> If they don't that is not my fault, and possibly their loss.
> 
> As my grandfather said; "There is never any harm in asking."

Indeed, that is a very good motto to have; and my grandfather always 
used to say "Patience is a virtue" :)

> But, unless one wants to go and live on one's own with a fat bank
> account to takes of one's needs (I wish !!!!), one has to do all that
> juggling to
> keep as many people happy as possible without putting other people's
> noses out of joint.

Haha - yes - quite.

Warmest Regards,

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list