LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Compressing image files on the server (https://www.linuxquestions.org/questions/linux-newbie-8/compressing-image-files-on-the-server-4175557372/)

AdultFoundry 10-28-2015 11:11 AM

Compressing image files on the server
 
I've been learning Linux from books, and I just got my first self-managed VPS server from ovh.com (https://www.ovh.com/us/vps/vps-ssd.xml).

I am configuring everything according to a website that I've found on the Internet, and I will be working on a program, which will be based on picture galleries, and this could be like 10k or 50k separate galleries, with around 15 image files per each.

These images get downloaded from xxx sponsor sites (something like NaughtyRevenue.com) by a program called Mech Bunny TGP script. Some of these image files turn out to be large in size (uncompressed, like 1.5 MB each) and it cant be this way because of bandwidth cost and download time.

For this reason, I was thinking to download them in bulk to my Windows hard drive, and compress them, but this would be taking quite a lot of time. I would need a download manager program, something to compress these files in bulk, it then would need to be uploaded to the server, and processed by the program, what takes time. Normally I can just add a list of urls, and the program will download them, and add them where they are needed there.

With this, since I am using command line Linux now, I was wondering if I could just download everything to the server, and compress selectively with the command line...

Is Linux compression (I can install whatever program would be needed, and configure it, obviously) as good as what I would get on Windows? If not, it would still make sense to use something a little worse, because it would save me a lot of time.

Can you tell me your opinion on this? Will it work and what would I use?

Thanks.

Smokey_justme 10-28-2015 11:16 AM

See http://www.imagemagick.org/script/index.php

Emerson 10-28-2015 11:17 AM

Images as pictures? Pictures like jpg, png, gif, etc are already compressed using advanced algorithms designed for pictures. They cannot be compressed further using a generic compression method.

Smokey_justme 10-28-2015 11:22 AM

@Emerson, sure they can... They can be transformed, resized or have different compression levels (which affects the quality)...

Emerson 10-28-2015 11:26 AM

Quote:

Originally Posted by Smokey_justme (Post 5441454)
@Emerson, sure they can... They can be transformed, resized or have different compression levels (which affects the quality)...

Exactly, all this affects quality. Without compromising quality they cannot be compressed any further.

schneidz 10-28-2015 11:28 AM

look into imagemagick in order to change each file using better compression (worse picture quality).

its the equivalent of going from cd quality sound to mp3 compression (most people think mp3 is good enough -- not as good as the original but worth it since each file would be about 1/10th the size of the original).

most media already use huffman encoding techniques so compressing them further would be a waste of time (at most 1% further reduction). for generic text files and such i think that bzip2 compresses best (ymmv).

AdultFoundry 10-28-2015 11:31 AM

Ok, so I am assuming that I can do everything with the ImageMagic program, that I've heard about before. Would it make sense to install the GUI on that server there, and view the images through this? Meaning, I would need to copy one of the images, see how it looks like, check how to resize it and compress it, and then apply it to like up to 5000 images from a certain site, or even more.

I know that these questions are a little basic, but I am a beginner and I dont have a general idea of how this would work. I imagine that command line would be a lot better an faster for this. But if I would install GUI there, I would need to connect to it through SSH (I read about it, it may be paid).

Edit: I can actually download an image through ftp, see how it looks, and work based on that.

Smokey_justme 10-28-2015 11:33 AM

@AdultFoundry.. Imagemagick is a command-line tool.. You don't need a GUI.. If I'm not mistaken, it actually doesn't have one... :P

suicidaleggroll 10-28-2015 12:04 PM

You already have a topic going on this, including an example of how to use imagemagick to compress the image files from the command line:
http://www.linuxquestions.org/questi...ls-4175557305/

schneidz 10-28-2015 12:59 PM

Quote:

Originally Posted by suicidaleggroll (Post 5441476)
You already have a topic going on this, including an example of how to use imagemagick to compress the image files from the command line:
http://www.linuxquestions.org/questi...ls-4175557305/

fyi: convert is part of the imagemagick package.


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