LinuxQuestions.org
Review your favorite Linux distribution.
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 07-06-2018, 09:22 AM   #1
grumpyskeptic
Member
 
Registered: Apr 2016
Posts: 291

Rep: Reputation: Disabled
How to convert a 36MB .png into a 500kb or so .jpg?


I tried the console command:

convert map.png map.jpg

and it only reduced it in size to 21MB. I cannot see anything in the convert help that is about specifying the compression or output file size.

The original png file is a map of population density without much detail and in shades of grey only. I think 500kb ought to be more than enough for it.

I am using Linux Mint 17.3 Cinnamon.

Thanks.
 
Old 07-06-2018, 09:30 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,333

Rep: Reputation: 6027Reputation: 6027Reputation: 6027Reputation: 6027Reputation: 6027Reputation: 6027Reputation: 6027Reputation: 6027Reputation: 6027Reputation: 6027Reputation: 6027
Quote:
Originally Posted by grumpyskeptic View Post
I tried the console command:

convert map.png map.jpg

and it only reduced it in size to 21MB. I cannot see anything in the convert help that is about specifying the compression or output file size. The original png file is a map of population density without much detail and in shades of grey only. I think 500kb ought to be more than enough for it. I am using Linux Mint 17.3 Cinnamon.
Not a lot of details to go on. The file size of the image is related to both the resolution of the image, and the color map on the image.

Trying to compress a 20000x20000 pixel image with a 32bit color map will only get you so far, no matter what you do. Any details about the image?
 
1 members found this post helpful.
Old 07-06-2018, 09:39 AM   #3
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 19.1 MATE
Posts: 8,018
Blog Entries: 5

Rep: Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872
Could you paste the output from:

Code:
file map.png
 
1 members found this post helpful.
Old 07-06-2018, 10:00 AM   #4
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,338

Rep: Reputation: 362Reputation: 362Reputation: 362Reputation: 362
How big a JPEG file is, depends on many things. Size (megapixels) is important. And forcing greyscale colorspace can help. Even if a picture looks grey, it could have some pixles that are not.

For example to resize it to max 2 megapixels (if it's more) and force it to grayscale:

Code:
convert -resize '2000000@>' -colorspace gray map.png map.jpg
 
1 members found this post helpful.
Old 07-06-2018, 04:44 PM   #5
grumpyskeptic
Member
 
Registered: Apr 2016
Posts: 291

Original Poster
Rep: Reputation: Disabled
Thank you Guttorm and others. I pasted

convert -resize '2000000@>' -colorspace gray map.png map.jpg

into the console and it converted the 36MB png into a 421.1KB jpg.

Thanks.
 
  


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 convert ODT to HTML with Images (png,jpg,...)? Xeratul Linux - General 8 06-30-2017 01:34 PM
convert .jpg to .png qrange Linux - Software 3 09-15-2011 07:21 AM
how do i convert to from gd2 (png, jpg) whysyn Linux - Software 3 09-18-2009 03:40 PM
convert image.png image.jpg changing colours MikeyCarter Linux - Software 1 11-17-2006 11:16 AM
Convert move frames (avi/dvi/etc) to images(png/jpg/etc) 3saul Linux - Software 1 03-05-2006 10:29 PM

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

All times are GMT -5. The time now is 10:58 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