LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-12-2011, 04:28 AM   #1
kingliang123
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Rep: Reputation: 0
Unhappy (imagemagick)why this command can not compress png image...


in imagemagick,
i have a png format picture, but it seems too big for me,
i wanna compress it ...
how can i do ...
command line...

Code:
convert "png.png" -strip -units PixelsPerInch -density 96 -quality 60 "png2.png"
this command can't compress the picture, the worse is: the size will be bigger...
 
Old 01-12-2011, 06:34 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
png files are ALREADY compressed. Compressing a file that is already compressed will often cause what you saw - the file actually grows in size.
 
Old 01-12-2011, 10:28 AM   #3
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,061

Rep: Reputation: 47
png is loss-less format so 'quality' setting has no meaning. what you need is jpg.
 
Old 01-12-2011, 03:44 PM   #4
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by qrange View Post
what you need is jpg.
I'd say that depends on the nature of the image. Large blocks of colour in a png tend not to stay that way after conversion to jpg. You are probably right though if their complaint is that the filesize is too large.

Perhaps if the OP were to attach or provide a link to the png in question someone could advise better.

I looked in to png filesize a few months ago when I found myself wanting to use png for some images because I needed them to have transparent sections but the filesizes where larger than I would have liked. (Several times larger than the transparency lacking jpg version of the image.) I came to the conclusion that there is often little you can do to reduce their filesize and if you can it might be very slow. There are tools and methods that will sometimes help though I don't recall finding anything in ImageMagick for it.

E.g. http://davidwalsh.name/pngcrush

Putting 'reduce png file size' will of course yield other suggestions.

The ImageMagick folks have their own forum at http://www.imagemagick.org/discourse...e547ab12e3bb69 so might be worth asking there.
 
1 members found this post helpful.
Old 01-12-2011, 08:45 PM   #5
kingliang123
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Original Poster
Rep: Reputation: 0
thanks all...
i find that, png format is hard to compress...
the size after i use optipng to compress,
just reduce 3k...
 
0 members found this post helpful.
  


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
How to compress a .png image in Gimp? ganoo Linux - Software 12 04-15-2015 07:33 PM
LXer: Imagemagick - Edit image from command line LXer Syndicated Linux News 0 08-29-2010 11:10 AM
imagemagick problem: height-and-width not deterministic when I crop an png file. centguy Linux - Software 2 09-09-2009 05:31 AM
convert image.png image.jpg changing colours MikeyCarter Linux - Software 1 11-17-2006 10:16 AM
command line image manipulation (imagemagick?) exodist Linux - Software 3 03-13-2006 01:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:06 AM.

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
Open Source Consulting | Domain Registration