Rotating PNG images

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Rotating PNG images

Bob Sneidar via use-livecode
I have just spent/wasted 60 minutes rotating 64 PNG images in GIMP
because LiveCode is incapable of rotating anything other than SVG images
without a bad case of the "jaggies".

Now I will have to import those 64 images into a stack and store them
somewhere
unseen to present inwith graphic objects .  .  . resulting in a
considerable overhead
in terms of physical storage,
RAM and coding time.

If GIMP (which is FREE) can rotate images of all sorts without any
perceivable
deterioration in image quality why can't LiveCode?

Richmond.
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Rotating PNG images

Bob Sneidar via use-livecode
if you set the resizequality of your images to "best" prior to rotating,
does it help? It should make quite a difference.

On Sun, Mar 4, 2018 at 3:48 AM, Richmond Mathewson via use-livecode <
[hidden email]> wrote:

> I have just spent/wasted 60 minutes rotating 64 PNG images in GIMP
> because LiveCode is incapable of rotating anything other than SVG images
> without a bad case of the "jaggies".
>
> Now I will have to import those 64 images into a stack and store them
> somewhere
> unseen to present inwith graphic objects .  .  . resulting in a
> considerable overhead
> in terms of physical storage,
> RAM and coding time.
>
> If GIMP (which is FREE) can rotate images of all sorts without any
> perceivable
> deterioration in image quality why can't LiveCode?
>
> Richmond.
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Rotating PNG images

Bob Sneidar via use-livecode
Not much.

Luckily I am building images where the part that needs
rotating is monochrome so that can
be rendeered as an SVG and imported into a widget.

This is, however, quite beside the point . . .

The inability of LiveCode to do something that nearly
every other program seems to manage "easily".

Richmond.

On 5/3/2018 5:22 pm, Mike Bonner via use-livecode wrote:

> if you set the resizequality of your images to "best" prior to rotating,
> does it help? It should make quite a difference.
>
> On Sun, Mar 4, 2018 at 3:48 AM, Richmond Mathewson via use-livecode <
> [hidden email]> wrote:
>
>> I have just spent/wasted 60 minutes rotating 64 PNG images in GIMP
>> because LiveCode is incapable of rotating anything other than SVG images
>> without a bad case of the "jaggies".
>>
>> Now I will have to import those 64 images into a stack and store them
>> somewhere
>> unseen to present inwith graphic objects .  .  . resulting in a
>> considerable overhead
>> in terms of physical storage,
>> RAM and coding time.
>>
>> If GIMP (which is FREE) can rotate images of all sorts without any
>> perceivable
>> deterioration in image quality why can't LiveCode?
>>
>> Richmond.
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Rotating PNG images

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
> Richmond M. wrote:
> Not much.
> Luckily I am building images where the part that needs
> rotating is monochrome so that can
> be rendered as an SVG and imported into a widget.
> This is, however, quite beside the point . . .
> The inability of LiveCode to do something that nearly
> every other program seems to manage "easily".

An image can't be rendered as an SVG. Or do you mean that it
is "traced" to an SVG? This is non-trivial (i.e. not "Not much").
The "nearly every other programs" (which else than Inkscape and
Gimp?) can't do it "easily", they all use "Potrace".

That can LC also easily do. I have already implemented it.

p.s. Are you really looking for PNGtoSVG in order to rotate an image?

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Rotating PNG images

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
When testing here on Ubuntu 14.04 images rotated at 90, 180, or 270 look
very good.

How can I reproduce what you're seeing?

Also, have you tried setting the angle property instead?

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Rotating PNG images

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
Erm . . .

Yes: I trace the monochrome images in Inkscape
and then import them into SVG widgets using my homegrown stack.

On 5/3/2018 6:30 pm, hh via use-livecode wrote:

>> Richmond M. wrote:
>> Not much.
>> Luckily I am building images where the part that needs
>> rotating is monochrome so that can
>> be rendered as an SVG and imported into a widget.
>> This is, however, quite beside the point . . .
>> The inability of LiveCode to do something that nearly
>> every other program seems to manage "easily".
> An image can't be rendered as an SVG. Or do you mean that it
> is "traced" to an SVG? This is non-trivial (i.e. not "Not much").
> The "nearly every other programs" (which else than Inkscape and
> Gimp?) can't do it "easily", they all use "Potrace".
>
> That can LC also easily do. I have already implemented it.

Aha! And is that publically available?
>
> p.s. Are you really looking for PNGtoSVG in order to rotate an image?

No, I'm not.

Richmond.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Rotating PNG images

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode


On 5/3/2018 6:33 pm, Richard Gaskin via use-livecode wrote:
> When testing here on Ubuntu 14.04 images rotated at 90, 180, or 270
> look very good.
>
> How can I reproduce what you're seeing?
>
> Also, have you tried setting the angle property instead?
>

There's no "instead", I set the angle on PNG images and they deteriorate.

Richmond.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Rotating PNG images

Bob Sneidar via use-livecode
On 5 Mar 2018, at 18:34, Richmond Mathewson via use-livecode wrote:

> I set the angle on PNG images and they deteriorate.

For clarity, are you setting the angle to something other than
90/180/270 degrees?

k

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Rotating PNG images

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
Richmond wrote:
> LiveCode is incapable of rotating anything other than SVG images
> without a bad case of the "jaggies".

RichardG wrote:
> have you tried setting the angle property instead?

Richmond wrote:
> I set the angle on PNG images and they deteriorate.



I find that

        rotate image 1 by 13

will often produce jaggies even if resize quality is best.
And the distortion increases with every iteration.

However, if find that

  set the angle of image 1 to 13

never deteriorates the image.

You can do the following all the livelong day without any jaggies in the image.

local ang

on spin
   repeat forever
      add 13 to ang
      set the angle of image 1 to ang
      if the commandKey is down then
         set the angle of image 1 to 0
         exit spin
      end if
   end repeat
end spin

Jim Lambert

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Rotating PNG images

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
No.

All fairly pedestrian stuff.


On 5/3/2018 9:43 pm, Keith Martin via use-livecode wrote:

> On 5 Mar 2018, at 18:34, Richmond Mathewson via use-livecode wrote:
>
>> I set the angle on PNG images and they deteriorate.
>
> For clarity, are you setting the angle to something other than
> 90/180/270 degrees?
>
> k
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Rotating PNG images

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
> Richmond M. wrote:
> There's no "instead", I set the angle on PNG images and they deteriorate.

Did you already try hhMockUp (from "sample stacks")?
I just tried with the LCC 1024x1024 logo.
Simply use the images menu there to import and then select it from that menu.

Works fine:
skewing, scaling, rotating all as single actions or (use check "All") in one
single all-in-one action.

Or even perspective transforms.

That's what LiveCode can do ...

(and Trace_to_SVG is now also available).

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Rotating PNG images

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
With the added WAIT this is a bit more fun to look at.
And it checks for angles > 32767.
You get an error if you set the angle of an image to greater than 32767.

local ang

on spin
   repeat forever
      add 13 to ang
      if ang > 32767 then
         beep
         put 0 into ang
      end if
      set the angle of image 1 to ang
      if the commandKey is down then
         --set the angle of image 1 to 0
         exit spin
      end if
      wait 0 ticks
   end repeat
end spin

Again this illustrates that setting the angle of an image does not distort the image, whereas rotating an image can distort the image.

Jim Lambert
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode