For Programmers: Free Programming Magazines  


Home > Archive > Tcl > February 2005 > How to image resize with img-jpeg extension ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to image resize with img-jpeg extension ?

2005-02-19, 3:58 pm

Hello,

Is there a way to resize a JPEG image with the img-jpeg extension ?

Thank you for the help,

Sean - HeliHobby.com


Roy Terry

2005-02-20, 3:58 pm

<born2net@sbcglobal.net> wrote in message
news:PcLRd.1365$Pz7.451@newssvr13.news.prodigy.com...
> Hello,
>
> Is there a way to resize a JPEG image with the img-jpeg extension ?


You can resize during an image copy like this

package require Tk
package require Img

set i1 [image create photo -file x.jpeg]
set i2 [image create photo]

$i2 copy $i1 -subsample 2
### $i2 now contains an image of 1/2
### dimension of the original

See the photo image page for
more details. There is a -zoom for
making images larger.

If you want non-integer resizing or
better pixel "averaging" on the resize
operations then check the
Tcl Wiki pages such as

http://mini.net/tcl/11924

or
http://mini.net/tcl/8448
http://mini.net/tcl/10504

and similar others on the wiki.

Roy

>
> Thank you for the help,
>
> Sean - HeliHobby.com
>
>



2005-02-21, 9:00 pm

Perfect ...

Now if I can only figure out a way to stop "packa req Img" from complaining
when I run it since I am running it in a shell and I am not running
X-Windows on that server ...

Any tips there ?

Thank you for the help,

Sean - HeliHobby.com

"Roy Terry" <royterry@earthlink.net> wrote in message
news:JQ0Sd.1424$MY6.533@newsread1.news.pas.earthlink.net...
> <born2net@sbcglobal.net> wrote in message
> news:PcLRd.1365$Pz7.451@newssvr13.news.prodigy.com...
>
> You can resize during an image copy like this
>
> package require Tk
> package require Img
>
> set i1 [image create photo -file x.jpeg]
> set i2 [image create photo]
>
> $i2 copy $i1 -subsample 2
> ### $i2 now contains an image of 1/2
> ### dimension of the original
>
> See the photo image page for
> more details. There is a -zoom for
> making images larger.
>
> If you want non-integer resizing or
> better pixel "averaging" on the resize
> operations then check the
> Tcl Wiki pages such as
>
> http://mini.net/tcl/11924
>
> or
> http://mini.net/tcl/8448
> http://mini.net/tcl/10504
>
> and similar others on the wiki.
>
> Roy
>
>
>



2005-02-22, 9:00 pm

Thank you ...
I will look into those packages ...

Regards,

Sean - www.HeliHobby.com

"Roy Terry" <royterry@earthlink.net> wrote in message
news:JQ0Sd.1424$MY6.533@newsread1.news.pas.earthlink.net...
> <born2net@sbcglobal.net> wrote in message
> news:PcLRd.1365$Pz7.451@newssvr13.news.prodigy.com...
>
> You can resize during an image copy like this
>
> package require Tk
> package require Img
>
> set i1 [image create photo -file x.jpeg]
> set i2 [image create photo]
>
> $i2 copy $i1 -subsample 2
> ### $i2 now contains an image of 1/2
> ### dimension of the original
>
> See the photo image page for
> more details. There is a -zoom for
> making images larger.
>
> If you want non-integer resizing or
> better pixel "averaging" on the resize
> operations then check the
> Tcl Wiki pages such as
>
> http://mini.net/tcl/11924
>
> or
> http://mini.net/tcl/8448
> http://mini.net/tcl/10504
>
> and similar others on the wiki.
>
> Roy
>
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com