The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 23, 2019, 12:36:23 AM

Login with username, password and session length


Pages: [1] 2
  Print  
Author Topic: how to automate scalling images !  (Read 3832 times)
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« on: June 18, 2009, 08:12:05 AM »

First : Perk, sorry I don't know where to put this topic so I've put it here ! You can move it where you want  Smiley

Second :

Is there a tool or a script that can resize 100 images to one specified width automatically ?

The images should be resized to a specified width but should retain their look !

Anybody ?

BIG

Thanks

 Need Help
Logged

what's up?
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: June 18, 2009, 08:17:10 AM »

I just did this a bit ago with GD and PHP. Look up the functions for GD and then google Resize Image GD PHP and you'll be able to follow the same path I did.

I was not entirely impressed with the resize. If I went in even increments (-50% etc) it was reasonable, but as soon as I did some different resizing, artifacts and fuzziness started to get bad.

For images that I really needed to look good I wound up creating a workflow in Adobe and hiring my daughter to do it.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« Reply #2 on: June 18, 2009, 08:21:32 AM »

I just did this a bit ago with GD and PHP. Look up the functions for GD and then google Resize Image GD PHP and you'll be able to follow the same path I did.

I was not entirely impressed with the resize. If I went in even increments (-50% etc) it was reasonable, but as soon as I did some different resizing, artifacts and fuzziness started to get bad.

thanks perk ! I'll try that !

For images that I really needed to look good I wound up creating a workflow in Adobe and hiring my daughter to do it.
Smiley
Logged

what's up?
vsloathe
vim ftw!
Global Moderator
Lifer
*****
Offline Offline

Posts: 1669



View Profile
« Reply #3 on: June 18, 2009, 08:26:55 AM »

libmagick would do you as well.
Logged

hai
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #4 on: June 18, 2009, 08:30:37 AM »

Doesn't that cost, for the real version VS? I thought I looked at that a couple years ago and it had a price tag... as I recall tho, it looked really good.

Also, as an edit: if you search here for it (it was only a few weeks ago) Nop posted how to use GD in Python and it seems that his access to different rescanning methods was better than in PHP, so if you are willing to use another language, you may get better results from gd.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« Reply #5 on: June 18, 2009, 08:35:56 AM »

Also, as an edit: if you search here for it (it was only a few weeks ago) Nop posted how to use GD in Python and it seems that his access to different rescanning methods was better than in PHP, so if you are willing to use another language, you may get better results from gd.

I'm willing do it the best way ... I don't give it much about quality ! I just want to do it automatically and to leave gimp alone for few weeks !

I'm searching now how to install python on linux  Grin
Logged

what's up?
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 2203


View Profile
« Reply #6 on: June 18, 2009, 10:15:31 AM »

for python u use this lib
http://www.pythonware.com/products/pil/
If is much easier to use

There is a GD binding for python kiking arround i think (i have never used it)
PIL is the easier to use
Logged
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« Reply #7 on: June 18, 2009, 10:18:47 AM »

for python u use this lib
http://www.pythonware.com/products/pil/
If is much easier to use

There is a GD binding for python kiking arround i think (i have never used it)
PIL is the easier to use


thanks nop ! I've just clicked on your last post and saw that you've posted here Smiley

Since I'm a n00b in python could you tell me please where should I copy this library ? in usr/bin ?  Roll Eyes
Logged

what's up?
vsloathe
vim ftw!
Global Moderator
Lifer
*****
Offline Offline

Posts: 1669



View Profile
« Reply #8 on: June 18, 2009, 10:23:37 AM »

Doesn't that cost, for the real version VS?

Poppycock! Why would I recommend payware?  Grin

http://www.imagemagick.org/script/index.php
Logged

hai
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #9 on: June 18, 2009, 10:26:49 AM »

Agreed it didn't make sense... I must be thinking of another lib I was investigating a few years back.

I'm going to give that (and iMagick and MagickWand) a look see... and preference of the two for extensions?
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
vsloathe
vim ftw!
Global Moderator
Lifer
*****
Offline Offline

Posts: 1669



View Profile
« Reply #10 on: June 18, 2009, 11:23:24 AM »

MagickWand is a bit more OO. I used them both, imagick calls sometimes return an object that is a MagickWand "wand".
Logged

hai
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 2203


View Profile
« Reply #11 on: June 18, 2009, 11:42:01 AM »

@NYDAz
You do not need to copy it anywhere.
Depending on ur linux distro if i remember correctly on ubuntu (and probably same with debian) you can install it from distutils.
(that is how i installed mine)
Also with ubuntu the binaries are most of the time also same version as source, unlike crap hat and other distros where they are like 400 years out of date.

Ussually for python libs.
Read the readme Smiley
But almost all python libs/packages they come with the distutils.
So inside the root directory there is a file call setup.py
a
"python setup.py build"  and then
"sudo python setup.py install" you have to be root
installs it where it supposed to go.

PIL is an exception but most other python packages are distributed with "easy_install" (same idea as ruby gems).
so you just go "sudo easy_install package" and it will DL it off the net, compile it and install.
Even better it will find all the dependency packages and install them also.
You can also use easy_install to install into a user directory.

On the first page of the docs there is an example on how to make thumbnails from a directory
http://www.pythonware.com/library/pil/handbook/image.htm
Logged
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« Reply #12 on: June 18, 2009, 12:01:41 PM »

@nop_90

Aaahhhhhhh ... don't you love to learn something every day !

let's see what we can do !

Thanks everyone  Praise
« Last Edit: June 18, 2009, 12:09:36 PM by NYDAz » Logged

what's up?
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« Reply #13 on: June 18, 2009, 12:24:05 PM »

ohhhhhh .... snap !

this little script is so fast and powerfull !

It's faster than me  Jackoff
Logged

what's up?
Bertje
Rookie
**
Offline Offline

Posts: 17


View Profile
« Reply #14 on: June 18, 2009, 02:26:33 PM »

Last time I needed that was when I was still doing pr0n. Anyway...
Photoshop>file>automate>batch
I think that did the trick.
Logged

No links in signatures please
Pages: [1] 2
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!