LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Compressing image files on the server (probably Imagemagick) (https://www.linuxquestions.org/questions/linux-software-2/compressing-image-files-on-the-server-probably-imagemagick-4175567958/)

AdultFoundry 01-26-2016 03:17 PM

Compressing image files on the server (probably Imagemagick)
 
I am fairly new to Linux and I've never used Imagemagick directly, and I am wondering if it will make sense to compress or resize images on a Linux system / server with this program.

I am importing around 10,000 picture galleries to the server (it may be less than that, this does not matter anyway) and they will be assigned to separate folders like

/contents/albums/main/200x150/3000/3001

10+ image files will be here, and like I said, I will have like 5,000 or more.

I was wondering if it will be fairly easy to do compressing and possible resizing with Imagemagick or would it be better to do it by hand on Windows, one by one (this may take a lot of time).

I am familiar with Linux, so I can take this path, but I am not sure whether it will be a good and possible thing to do.

AdultFoundry 01-26-2016 03:54 PM

I may need to / do something like this:

1) Import all picture galleries to the server
2) Find folders which are the largest the size, above a certain acceptable level
3) Then I would need to look at these pictures, get familiar with what it is
4) Test different settings that would be the best
5) Run some kind of compressing (and possibly resizing, but not likely) commands in bulk on these files

I guess it is all possible, and when I look at the list of galleries (it is actually around 5,000), it does not make sense to be doing it by hand (checking every url manualy, looking at the images / sizes, and so on).

There may be other ways of doing this too, but I am not sure. Like some kind of software or some kind of feature or addon to Photoshop. Generally 5,000 image galleries with 15 images each, and not all of them are of the same size (galleries start in year 2008 and the latest one has been added now, 2016), and they are not published in the same way.

MensaWater 01-26-2016 04:00 PM

I'm no expert but ImageMagick has various commands. The mogrify command it comes with allows for resizing (which I've done) and compression (which I've not). This can be run from command line so can be scripted. You could also script size comparisons. Scripting review of the ones above a certain size might be trickier as that would require a display to see the pictures rather than just command line.

Emerson 01-26-2016 04:09 PM

Most picture formats are already compressed, don't expect any further compression.

AdultFoundry 01-26-2016 04:15 PM

Quote:

Originally Posted by Emerson (Post 5487714)
Most picture formats are already compressed, don't expect any further compression.

Galleries start from year 2008 and are getting added until now, 2016. Image sizes in the oldest ones are around 150KB and thats ok, and the newer ones have sizes of around 500KB, which is too big. It is around 5,000 galleries, and a total of around 75,000 images, so this adds up. I am also asking about it on non-Linux forums, general webmaster ones, and I will see what info I can get from there. Linux can be good, as long as Imagemagick is not bad for this. There is a lot of Windows software for it too, and if I would like to download images to separate folders I would need to pay for a program which does it, and this costs around $40 (the only one good for it, I think). Then it takes work to do everything manually, and import images to the script in less automatic way.

Overall, I want to do it good. It is a good site that I am working on and if everything goes as planned it will be a high traffic site. I will have more galleries like this too, from other places, so a good method of doing this, would be very good.

MensaWater 01-26-2016 04:51 PM

While its true normal compression tools like gzip won't do much to a picture file the mogrify command will let you change things related to pixes with the -compress flag and the the quality (which affects how much detail and presumably the size in bytes) it stores with the -quality flag.

I've not done this but the following talks about it:
http://superuser.com/questions/79287...-mogrify/79289


All times are GMT -5. The time now is 09:50 PM.