LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-19-2008, 12:11 AM   #1
teachret
LQ Newbie
 
Registered: Jun 2008
Posts: 2

Rep: Reputation: 0
How to resize photo for email?


Just received my new eeePC with Linux and plan to use it for travel. Would like to download pictures and then share with family through email. While I have resized jpgs with Windows for years, I have not figured it out with Linux. Is there a way to change a 570 kb to a 57kb jpeg with Linux or do I need additional software? And if so, what is recommended and easy? Thank you.
 
Old 06-19-2008, 12:22 AM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
There is probably a better way than what I do, but I open the original in the 'GIMP', select 'save as' choose 'jpeg' and use a "quality factor" of around 32. That can shrink 2MB to 78KB (it really depends on the picture). I find that most times values below 32 give too many artifacts and poor color.

Don't overwrite your originals!
 
Old 06-19-2008, 01:56 AM   #3
ischi
Member
 
Registered: Apr 2008
Location: Tübingen
Distribution: Fedora 9 (Thinkpad T60), Debian 3.1 (Server)
Posts: 51

Rep: Reputation: 15
Or you could reduce the Resolution ... in GIMP you would do this by scaling the Image, I dont know from the Top of my head but there is a Option "Scale" in the MEnu somewhere, where you can enter the new resolution and then Save as... Or combine the 2 Scale the Resolution and the Quality.

GIMP would be the right tool so.
 
Old 06-19-2008, 03:19 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
If you have an ImageMagick package installed you can use the "convert" program to resize photos as well.

This will resize all jpeg pictures in the current directory.
Code:
for photo in *.jpg; do
   convert -resize 25% "${photo}" small-"${photo}"
done
You could instead use "-resize 100x" to resize the photos to a width of 100 pixels, yet keeping the aspect ratio.

Using "-resize "500x>" will reduce the size of pictures that are more than 500 pixels wide, but leave smaller pictures alone.

The ImageMagick package installs html based instructions in /usr/share/doc/ImageMagick-<version>/www or /usr/share/doc/packages/ImageMagick/www, depending on the convention that is used in the eeepc.
 
Old 06-19-2008, 06:02 AM   #5
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 55
you can also play with the quality. jpegs size decrease very quickly for a small quality decrease, which is not noticeable by a human.
For a compression level of 90:
convert -quality 90 -resize 25% "${photo}" small-"${photo}"

I use convert
-geometry "50%x50%"
but there is also -scale and now I see that there is resize also.. not sure what the difference is.

Quote:
Originally Posted by jschiwal
-resize "500x>"
Thanks for the tip, that's interesting!
 
Old 06-19-2008, 06:56 AM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,087

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
If you are using KDE, there's a beautiful set of scripts called KIM (Kde Image Menu) by Charles Bouveyron.

KIM is a "front-end" to imagemagick: In konqueror R-click in an image file - Actions- KIM Convert (between formats) / Resize (filename is renamed as filename-resized), even publish as html, flash animations etc. It is perfect, and easily customisable / extensible. I like it very much. It is also a good example of how to make your own KDE servicemenus.

Get it here: http://linux.softpedia.com/get/Multi...Kim-2263.shtml

Last edited by tredegar; 06-19-2008 at 09:08 AM. Reason: KDE servicemenus
 
Old 06-19-2008, 09:40 AM   #7
fair_is_fair
Member
 
Registered: May 2005
Posts: 516

Rep: Reputation: 52
For emailing photos Picasa is hard to beat. It will automatically resize photos with no hoops to jump - just set the size you need.

I know many do not like the linux version because it is essentially a windows app running via wine but it still rocks.
 
Old 06-19-2008, 10:03 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
There is a package of image utilities called ImageMagick. One of the programs, convert allows you to easily convert from one format to another or to resize pictures.

example:
convert rose.jpg -resize 50% rose.png

You can easily convert a batch of pictures:
Code:
#lets create a destination directory
mkdir small

#resize all jpeg pictures in the directory to a width of 256 pixels
for picture in *.jpg; do
   convert "${picture}" -resize -x256 "${picture%.jpg}"-s.jpg
done
If you have ImageMagick installed you may have html documentation installed in /usr/share/doc/ImageMagick-<version>/.
 
Old 06-19-2008, 04:29 PM   #9
teachret
LQ Newbie
 
Registered: Jun 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Cool Eureka! Resizing Accomplished

Using the information sent out, I was able to plod my way through and was able to take a jpg from 557KB to 84KB. This is what I did:
In Photo Manager R-Click on a picture to resize.
Select---External Tools----Kolour Paint
In Paint Select the pull down file "Images"----Resize/Scale
Choose Smooth Scale, "X" Keep Aspect Ratio, Scroll to 50%, "ok"
Under the pull down for File----Save As---Rename the file (I just put an "e" in front of the name to designate it as an emailable file.) It will ask if you really want to: "Yes"
Thanks for the help. Now my little eeePC will be a great addition to our trips.
 
Old 06-19-2008, 05:34 PM   #10
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,087

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
Quote:
Eureka! Resizing Accomplished
Why are you insisting on going through all these commands / clicks / hoops and difficulties?

Just install KIM, and all this resizing is one Right-click-away.

The link is above, here (again) http://linux.softpedia.com/get/Multi...Kim-2263.shtml

I also have an "EEE", KIM is installed: It is brilliant, and if you read the scripts it provides, a good educational tool too.

"You can lead a horse to water ..."

'Nuff said.
 
Old 06-20-2008, 03:09 AM   #11
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 55
"montage" is also very interesting, you can put several pictures on a webpage. This is the script I use:

Code:
montage -size 400x400  'Photos-2008*'  -thumbnail 200x200   -font /usr/X11R6/lib/X11/fonts/TTF/Vera.ttf         -set caption '%t' -bordercolor Lavender -background grey40      -gravity Center      -pointsize 9  -density 144x144  +polaroid  -resize 50%            -set label ''  -background white  -geometry +1+1  -tile 5x            index.html
+polaroid is a very nice effect
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LVM Resize - After logical resize, FS size does not match physical size. spectra Linux - Software 6 11-01-2006 12:28 PM
Wanted: Batch Email Script for Snapfish photo-uploads mpm Linux - Software 1 05-29-2006 12:48 AM
any photo viewer with lossless photo rotation? zecodela Linux - Software 1 10-24-2004 11:22 PM
How to Import Microsft outlook Email in any Red hat 9 Email Software mobassir Linux - Software 0 07-26-2003 05:08 AM
How do I: convert my fetchmail email file to separate email files? ancientt Linux - Software 1 02-03-2003 03:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration