best way to make images smaller?

Forum rules
We believe in Hello and Thank You.
aaah
Oyster-Slurper
Posts: 21
Joined: Wed Mar 09, 2016 12:38 pm

best way to make images smaller?

Unread post by aaah » Thu Oct 20, 2016 3:49 pm

If you were sending photos by email or making pictures smaller for posting on the web how do you make them small but keep reasonable qual?
I just tried imagemagick with the command
convert test.jpg -resize 50% half_test.jpg
and then took the same photo but uploaded it to tinypng.com
and the site produced a much smaller filesize but no noticable diff. in quality without even making it smaller in dimensions.
What do you guys use?

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: best way to make images smaller?

Unread post by machinebacon » Thu Oct 20, 2016 6:06 pm

imagemagick's convert, too. This is a must-read: https://www.smashingmagazine.com/2015/0 ... agemagick/

tl;dr

Code: Select all

mogrify -path OUTPUT_PATH -filter Triangle -define filter:support=2 -thumbnail OUTPUT_WIDTH -unsharp 0.25x0.25+8+0.065 -dither None -posterize 136 -quality 82 -define jpeg:fancy-upsampling=off -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=1 -define png:exclude-chunk=all -interlace none -colorspace sRGB -strip INPUT_PATH
..gnutella..

aaah
Oyster-Slurper
Posts: 21
Joined: Wed Mar 09, 2016 12:38 pm

Re: best way to make images smaller?

Unread post by aaah » Thu Oct 20, 2016 6:24 pm

I just found it interesting that even with a -quality setting of say 60 the result was still a larger size than some of the online resizers and I couldn't see any difference in how it looked.
Edit, I read you link, it was epic!
Last edited by aaah on Fri Oct 21, 2016 10:54 am, edited 1 time in total.

User avatar
wuxmedia
Grasshopper
Posts: 6454
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: best way to make images smaller?

Unread post by wuxmedia » Thu Oct 20, 2016 9:06 pm

if you like tinypng - it has an API:
https://tinypng.com/developers/reference
"Seek, and Ye shall find"
"Github | Chooons | Site"

User avatar
ivanovnegro
Minister of Truth
Posts: 5449
Joined: Wed Oct 17, 2012 11:12 pm

Re: best way to make images smaller?

Unread post by ivanovnegro » Fri Oct 21, 2016 12:18 am

Imagemagick all the way.

It has tons of options. There are people using Gimp but I prefer the magick stick.

Also a must read:

http://www.imagemagick.org/Usage/resize/

aaah
Oyster-Slurper
Posts: 21
Joined: Wed Mar 09, 2016 12:38 pm

Re: best way to make images smaller?

Unread post by aaah » Fri Oct 21, 2016 10:21 am

ok then I shall experiment with i.m. to see if I can get it to rival the results online.
i.e. file size and quality

aaah
Oyster-Slurper
Posts: 21
Joined: Wed Mar 09, 2016 12:38 pm

Re: best way to make images smaller?

Unread post by aaah » Fri Oct 21, 2016 12:43 pm

ok messed with imagemagick but found it fiddly, ended up using a combo
for resizing dimensions and optimizing for smaller file size I use imagemagick combined with cjpeg, so I put this in my bash funcitons

Code: Select all

resizeand() {
  convert -resize 50% "$1" TGA:- | 
  cjpeg -outfile cjpeg-compressandresize-image.jpg -targa
}
but just for reducing file size but not dimensions I prefer just cjpeg

Code: Select all

optimage() {
	cjpeg -quality 70 -outfile cjpeg-compressed-image.jpg "$1"
}
cjpeg is giving me files sizes to almost match tinypng.com
I read about cjpeg here
http://calendar.perfplanet.com/2014/mozjpeg-3-0/
but you have to compile it yourself, easy to do though.
ps, why do all my posts have to be read by a moderator first?!

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: best way to make images smaller?

Unread post by machinebacon » Fri Oct 21, 2016 3:14 pm

ps, why do all my posts have to be read by a moderator first?!
This I wonder, too... I guess we moved you into the bad boys section together with some bots, Chinese shoes sellers and Nigerian scammers. Should be OK now ;)
..gnutella..

aaah
Oyster-Slurper
Posts: 21
Joined: Wed Mar 09, 2016 12:38 pm

Re: best way to make images smaller?

Unread post by aaah » Fri Oct 21, 2016 6:06 pm

jesus, I guess I could be persuaded to sell shoes for the chinese but not scam for the Nigerians!

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: best way to make images smaller?

Unread post by machinebacon » Sat Oct 22, 2016 7:02 am

DEAR!

MY NAME IS MUMBALE MBAMBO, PRESIDENT OF SUDAN OIL CORPORATION!
..gnutella..

Post Reply