LinuxQuestions.org
Help answer threads with 0 replies.
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 02-28-2005, 09:26 AM   #1
ganoo
LQ Newbie
 
Registered: Jan 2005
Posts: 15

Rep: Reputation: 0
How to compress a .png image in Gimp?


I've managed to take a .png screenshot image of my desktop and I'd like to send it to a website that displays desktop screenshots, but my image is 1,3 MB in size and the website accepts only images that are smaller than 300 KB. I've got Gimp installed and I can use it to view the image, but I cannot figure out how I could use Gimp to compress my screenshot image to make it smaller than 300 KB. I have zero experience in manipulating graphics, so any advice to help me get started would be very much appreciated.
 
Old 02-28-2005, 10:00 AM   #2
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
Click Image> Scale Image and reduce the size of the image in pixels. Then save it as a jpeg. Click File> Save as> Select File Type and reduce the quality
 
Old 02-28-2005, 11:10 AM   #3
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Keep in mind that jpeg uses (very) lossy compression (it throws out details the algorithm thinks is not important) whereas PNG uses lossless compression. If you want to retain high definition in your photographs stick with the PNG format. If detail is not all that important then by all means jpeg may be the right option for you.

BTW: screenshots look particularly bad when saved as jpeg (as does all line art) so you may want to save as either a dithered eight-bit PNG file or as a dithered GIF file. It will be limited to only 256 indexed colors but rather than throwing definition out, those algorithms will resample the colors, pick the best 256 (well, 254 plus black and white) and dither the coloring, while retaining the sharp lines of your screenshots.

As far as using compression with PNG in The Gimp, which is the question you asked, do the following (as of The Gimp 2.0.0):

Click File -> Save As
Select "PNG" in the Determine File Type
Enter your filename and click OK

Next you will see a "Save as PNG" dialog - in here you can set various options, including the compression level. I'd avoid interlacing as it increases the file type slightly, and since most people are on broadband now there is little benefit to interlacing raster images.
 
Old 02-28-2005, 12:06 PM   #4
ganoo
LQ Newbie
 
Registered: Jan 2005
Posts: 15

Original Poster
Rep: Reputation: 0
Saving my screenshot in .jpg format reduced the size from 1.3 MB to 175 KB. Then I tried .png with indexed colors, choosing "Use web-optimized palette" in Gimp. This produced a 200 KB image but the colors don't look very good (at least on my screen). Then I tried indexed .png with the "Generate optimum palette" in Gimp and this produced a better-looking image, but the size is 484 KB (too big). The website in question accepts both .jpg and .png images, so I think I'll just upload the .jpg version of my screenshot. Many thanks!
 
Old 02-28-2005, 01:48 PM   #5
NoStop
Member
 
Registered: Feb 2005
Location: Canada
Distribution: Debian Etch - Enlightenment E17
Posts: 116

Rep: Reputation: 15
I found having to open up a large application like Gimp just to resize an image, took more time than I wanted to use when dealing with this kind of situation. I'm often needing to resize an image. Then I found out about the power of ImageMagick and wrote a little bash script so that at the command line I could simply type:

resizeimg <filename> to get a smaller image created.

If you're interested, you can find the script and instructions here:

http://www.w-3productions.com/cvcs/w...tip_quick.html

Cheers,
Rene
 
Old 09-26-2014, 10:20 PM   #6
fhleung
Member
 
Registered: Aug 2004
Distribution: Lubuntu Live OS
Posts: 432

Rep: Reputation: 30
the topic was: How to compress a .png image in Gimp?

what about do it in command line?
anyone knows if command can also do that?
 
Old 09-27-2014, 01:35 AM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,616

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
you do not use "the Gimp" in the terminal
it needs to run as the GUI

so

for WHAT text ONLY graphics program or library do you want to use ?

the old program "pngCrush"
Imagemagic ?
Gmic ?
Cimg.h ?
the old DevIl ?
the even older XV ?
your own custom c program calling libpng

what ?

Last edited by John VV; 09-27-2014 at 01:36 AM.
 
Old 09-27-2014, 01:39 AM   #8
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,249
Blog Entries: 24

Rep: Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190
In case you did not notice, this is another necro post... but ImageMagick resize is still good advice.

Last edited by astrogeek; 09-27-2014 at 01:41 AM.
 
Old 09-27-2014, 04:09 AM   #9
fhleung
Member
 
Registered: Aug 2004
Distribution: Lubuntu Live OS
Posts: 432

Rep: Reputation: 30
ImageMagick ?? It can re-size the image pixel?

what I'd like was compression = reduce memory (MByte size to KByte)



John VV Guru, I asked the wrong thing... if I got an animated .GIF image, can I also reduce its memory size by which tool?

Last edited by fhleung; 09-27-2014 at 04:31 AM.
 
Old 09-27-2014, 08:50 AM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052
yes.

imagemagick (command line: convert, mogrify) can do just about anything.


ps: fully aware of thread age. but, why not...
 
Old 09-30-2014, 12:45 AM   #11
fhleung
Member
 
Registered: Aug 2004
Distribution: Lubuntu Live OS
Posts: 432

Rep: Reputation: 30
Code:
convert input.gif -quality 1 output.gif
the memory size of the output animated .GIF
no big difference...

Last edited by fhleung; 09-30-2014 at 01:00 AM.
 
Old 04-15-2015, 04:06 AM   #12
fhleung
Member
 
Registered: Aug 2004
Distribution: Lubuntu Live OS
Posts: 432

Rep: Reputation: 30
http://php.net/manual/en/book.imagick.php

alternatively, in case if not ImageMagick, you may try php script web version

or download http://www.imagemagick.org/download/...86-windows.zip

Last edited by fhleung; 04-15-2015 at 04:16 AM.
 
Old 04-15-2015, 08:33 PM   #13
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,616

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
fhleung
you are aware that this thread was started in 2005
it is 10 years old


and that link is to the MICROSOFT!@!!!!!!!! build of IM Q16

why the bleep would one use a windows exe in wine when there are q16 builds in almost EVERY operating system repos

imagemagick is so slow as it is that adding WINE to the mix is well ?????????????
 
  


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
What's the best way to compress image files in Linux? tgardner Linux - Software 2 06-03-2009 11:39 AM
Problem with PNG image in Java on Redhat Shariq Mustaquim Linux - Software 2 06-24-2005 07:37 AM
GIMP doesn't save Gamma changes in .PNG format pujolasdf Linux - Software 0 02-16-2005 04:58 PM
PHP PNG image file parsing Proud Programming 4 08-04-2004 01:55 PM
Image conversor bmp & png to jpeg Adony Linux - Software 2 06-19-2004 04:43 PM

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

All times are GMT -5. The time now is 05:30 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
Open Source Consulting | Domain Registration