Author Topic: Image resizing, command lines, gui apps my favorites, your favorites...  (Read 2012 times)

Offline melodie

  • Hero Member
  • *****
  • Posts: 5945
  • Internet Relay Chat sur Freenode
    • PCLinuxOS Fr
Hi,

I just asked for a package for Rarig yesterday and Scoundrel already had to act twice at that thread. I'll try here to make it a productive post, that can be used by all.

I recently had to create a website for a girl-friend of mine, who is an artist and also has to learn almost everything about using a computer without sending her files accidently in the trash can.

So I asked her to bring her directories with the pictures of the frames she had painted, to create the galleries. I wouldn't use anything else than a command line with convert do change the 3 and 4 MB wide pictures into something that can fit in the galleries, of course, but later she will have to manage by herself. What can I do ? Teach here how to use Irfanview ? (win32 app). Teach here how to use ConversionMagick ? (win32 app too, a gpl gui to Image Magick) I tried that, she didn't understand anything about what things do there, although this one seems quite simple to me. I want to install PCLinuxOS in her machine and make her learn to use it, but I don't know yet if she has enough motivation to learn even the basics.

Anyhow very small app doing little, but right what we need to make pictures small very easily would be a very good idea. This can help under PCLinuxOS for the simple thing most people do at least once a while : send pictures to the family. We have to fancy that many many people just know how to start, shutdown and well, what is the difference between left click and right click ? You can't imagine how many times I have started to explain that to some friends of mine !

This intro is long enough now, the environment has been described. ;)

Command line:

Install Image Magick and it's depends.
One shell script I use:
Code: [Select]
#!/bin/sh
mkdir modif
for i in `ls *.*`;do convert $i -resize 25% -quality 85 -interlace line modif/$i ; done

#cd modif
#mkdir alendroit
#for i in `ls *.*`; do convert $i -rotate 270 alendroit/$i ; done

"modif" stands for modification. The script here after it converts an image to 25% of it's original size retains 85% of it's previous quality, makes it appear progressively (interlace line) and sends the result to the directory "modif".

This is good for batch resizing. 85% offers optimal ratio quality/weight. I have done tests with 80%, 90% and I came back each time to 85%. Sometimes I change 25% to another value, according to the first result I get.

This script is not perfect, as when I start it from the directory where there are images, it tries to convert itself as well, which results each time with an error. If you know how to fix it ? :D

The second part where it's commented is for eventual pictures not being correctly oriented. the option rotate can take other arguments, such as 90, and 180.

I also often add the "-strip" argument that takes of the exif informations, allowing to reduce the size of the image even more.

Resizing with Gimp : it is difficult to use for this purpose without loosing quality. There is a method, working on the canvas, but it's complicated, I have not succeeded in retaining how to do that the one time I was shown, and it's not ok for several images at same time.

ImageMagick gui : many menus, I use the one "view > resize", once a while when I have only one image to resize. Or I use the command line "convert -resize ... image_origine.png image_destination.png". In this case, you need to provide a name for the new image created.

There is a trick with "crop", I think, so that you can replace the image source by the image modified, but I'm not sure.

Another tool which is very nice to use, for batch resizing is fotoxx. I tried it recently and I found it to do even a better job than the command line ! The images I got from there were a bit smaller in weight that the ones with the Image Magick command lines (convert and options), and the images looked like there even had a nicer look.

For people who are very beginner I was told about and tried Rarig, for which I am requesting a package now:
(New) Rarig - image resizing made easy - http://www.pclinuxos.com/forum/index.php/topic,88565.0.html



Really easy, although I would have liked one or two more features in a program such as this one, but well, it's very very simple to use.

At the packages suggest thread, Ramchu and pirate state that KIM is enough for their needs : he men ! you're not alone around here, many people including me never use KDE !!! And therefore don't use Dolphin either !

Now I can say it, I'm not in packages request here ! ;D

Ok, please if you have more tricks for image resizing, you are welcome to continue the discussion.




melodie at #lpic-fr on irc.freenode.net

Offline Ramchu

  • Hero Member
  • *****
  • Posts: 1593
Quote
At the packages suggest thread, Ramchu and pirate state that KIM is enough for their needs : he men !

I don't see how, Why not just use Kim, is a statement .

It was to be a suggestion.
 
Sorry if it doesn't/won't work for you.

No need to be upset over it.

Have a Good Day !


Offline melodie

  • Hero Member
  • *****
  • Posts: 5945
  • Internet Relay Chat sur Freenode
    • PCLinuxOS Fr
It was to be a suggestion.
 
Sorry if it doesn't/won't work for you.

No need to be upset over it.

Hi, not upset, I just wanted to answer about it, but that was not the right place. and ok for "s/state/suggest/", that's not a problem for me.  :)

melodie at #lpic-fr on irc.freenode.net

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3881
That program looks interesting. I use Kim some of the time, but it doesn't always do what I want, so new options are worth considering. (I'm not always in KDE, either ;))

If you are scripting with imagemagick, here is a useful link:
http://www.4p8.com/eric.brasseur/gamma.html#examples

and example code:
Code: [Select]
convert in.png -depth 16 -gamma 0.454545 -resize 50% -gamma 2.2 -depth 8 out.png
I'm also looking to package this program for smart png compression with a gui: Trimage

Galen



Online scoundrel

  • Administrator
  • Hero Member
  • *****
  • Posts: 4585
  • Philosophy= Bigger Hammer
that Trimage looks promising
Please Donate Today..Or I Will Make You Wish You Had

Offline Yankee

  • Hero Member
  • *****
  • Posts: 1517
  • In theory, theory=practice, in practice ???

Hi,

Most programs I try to resize pictures with work OK if downsizing, but lose resolution with
upsizing.  If I crop a picture with Picasa and upsize it to 16:9 it always loses some
resolution.  You would think the computer could rearrange the pixels to avoid this but it
doesn't, at least not yet.  ImageMagick is probably a good first or second choice.
Small amounts of upsizing are usually unnoticeable and OK with most programs.


FF

ASUS EeePc 900HA netbook  1.6 Ghz Atom CPU  1GB RAM
160 GB internal HD    Seagate 250 GB USB portable drive 
Intel ‎Mobile 945GSE Integrated Graphics Controller
Atheros AR242x/AR542x Wireless Network Adapter
Intel (N10/ICH7 Family) High Definition Audio
Dynex 5-Button Wired Optical Mouse
LXDE

Offline pags

  • Hero Member
  • *****
  • Posts: 2602
  • Keep it clean.

Hi,

Most programs I try to resize pictures with work OK if downsizing, but lose resolution with
upsizing.  If I crop a picture with Picasa and upsize it to 16:9 it always loses some
resolution.  You would think the computer could rearrange the pixels to avoid this but it
doesn't, at least not yet.  ImageMagick is probably a good first or second choice.
Small amounts of upsizing are usually unnoticeable and OK with most programs.


FF



Upsizing will never be perfect (it'll be blocky, or fuzzy, or something, etc).  The problem is that the computer can't create something from nothing, and upsizing is adding data (but, not meaningful data...usually duplicate or interpolated)

Scaling down is removing data, so the dataset and the displayed resolution are "in sync" (that is to say, there is valid pixel data for each displayed pixel location).  The quality of a down-scale comes from how well inconsistencies can cleaned up...

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3881
But they do it in the movies and tv. Are you telling me that stuff is made up?  ;D ;D

Galen

Offline pags

  • Hero Member
  • *****
  • Posts: 2602
  • Keep it clean.
But they do it in the movies and tv. Are you telling me that stuff is made up?  ;D ;D

Galen

;D ;D ;D ;D

Got the killer's face from the three pixel reflection in the victim's eye from a digital photo taken by some tourist couple...

nah, that's real, for shure!

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3881
But they do it in the movies and tv. Are you telling me that stuff is made up?  ;D ;D

Galen

;D ;D ;D ;D

Got the killer's face from the three pixel reflection in the victim's eye from a digital photo taken by some tourist couple...

nah, that's real, for shure!

Thanks for the reassurance, I was starting to get skeptical! ;)

Galen

Offline wayne1932

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1089
Re: Image resizing, command lines, gui apps my favorites, your favorites...
« Reply #10 on: March 22, 2011, 09:02:20 AM »
OK, I need something to do a batch file resizing of some jpg pictures.

Tell me about kim.  I opened synaptic, installed it, and now looking for it. 

It is not in the Kmenu,

Tried running "kim" "Kim" and "KIM" in console and got "command not found" message.

Thanks
If it ain't broke, DON'T fix it!  If ya cain't fix it, ya gotta stand it.  If ya cain't stand it..............Visit the forum and search.

Offline melodie

  • Hero Member
  • *****
  • Posts: 5945
  • Internet Relay Chat sur Freenode
    • PCLinuxOS Fr
Re: Image resizing, command lines, gui apps my favorites, your favorites...
« Reply #11 on: March 22, 2011, 09:30:52 AM »
Hi,

As I understood it, it should be available in the right click in Dolphin. I can't check, because I don't use KDE.

You could use my bash script if you have Image Magick suite installed... or you could use Fotoxx, it's easy.
melodie at #lpic-fr on irc.freenode.net

Offline Meemaw

  • Hero Member
  • *****
  • Posts: 2729
  • Never stop learning!
Re: Image resizing, command lines, gui apps my favorites, your favorites...
« Reply #12 on: March 22, 2011, 09:37:33 AM »
Tell me about kim.  I opened synaptic, installed it, and now looking for it.  

It is not in the Kmenu,

Tried running "kim" "Kim" and "KIM" in console and got "command not found" message.
It will be in Dolphin.... as melodie says.

If you will right-click on the picture you wish to change, there will be an 'Actions' item in the menu... navigating to that will give you kim with the choices you have.

However, those of us who don't run KDE can't install kim without a lot of KDE libraries.... (I'm using XFCE)  In Thunar, you can add some 'right-click' options to your menu. (You have to have ImageMagick installed but I think it's already in XFCE) In Thunar, go to Edit > Custom Actions.... in the window you see click on the + sign to add one - say you want to convert your jpg to a png.
The first tab in the box will have Convert JPG to PNG in the Name blank, and whatever you want in the description, then  convert %F `basename %F .jpg`.png   (make sure it looks just like that!)
The second tab will have File pattern: *.jpg;*.jpeg;*.JPG;*.JPEG, with "Image Files" box checked.

(Sure sounds like I'm smart, huh?  Nope!  I got this from parnote!!!   Thanks, parnote!!!)
 :D
Meemaw
PCLinuxOS Magazine Asst. Editor



We miss you, Joble!!!

Offline wayne1932

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1089
Re: Image resizing, command lines, gui apps my favorites, your favorites...
« Reply #13 on: March 22, 2011, 07:22:14 PM »
Thanks for the hint about Kim.

I would never have guessed that it was under Actions.  To my mind, not logical, but we are all different. 

 I tried fotoxx but file management with it seems to be so convoluted.  I'm sure that down at the lowest level, they are running the same programs, but this GUI was just awkward.
If it ain't broke, DON'T fix it!  If ya cain't fix it, ya gotta stand it.  If ya cain't stand it..............Visit the forum and search.

Offline Rudge

  • Hero Member
  • *****
  • Posts: 9773
  • I'm Just A Dog.
Re: Image resizing, command lines, gui apps my favorites, your favorites...
« Reply #14 on: March 22, 2011, 08:02:40 PM »

(Sure sounds like I'm smart, huh?  Nope!  I got this from parnote!!!   Thanks, parnote!!!)
 :D

Nice to give credit Meemaw but it doesn't matter where you got it. It's yours now.  ;)


-If you wish to make an apple pie from scratch, you must first invent the universe-  Carl Sagan