Web Analytics Made Easy -
StatCounter Imagemagick - Great program? Maybe... but lousy execution in usage deployment - CodingForum

Announcement

Collapse
No announcement yet.

Imagemagick - Great program? Maybe... but lousy execution in usage deployment

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Imagemagick - Great program? Maybe... but lousy execution in usage deployment

    In this thread - https://www.codingforum.net/forum/cl...57#post2435457 - John_Betong recommended Image Magick. Having tried to get it to work for the last 4-5 hrs on a Windows XP machine and then on a Linux Mint 18.3 partition (on the same laptop) without success, this is a classic example of a supposedly 'great' program being let down really badly by the myopic view of the developer of said program. I say myopic because there are tons of assumptions made in the documentation. There isn't even a simple 'how do you get it to work' explanation from what I could see. All I could find were commands of how to do various actions. What I was looking for was 'this is what you do to use this program' which gave step by step instructions.

    In the end I found this site http://bulkresizephotos.com within seconds of doing a search for 'bulk resizing of images'. And it was online too. No faffing around with installations or trying to figure out how something works. Doing the resizing took less than 4 minutes of uploading, resizing, downloading and extracting. I suspect they even use the actual ImageMagick engine for doing the resizing.

    So thanks for the recommendation John_Betong but that is an awful program to use (which I never got working at all). It may be GREAT at what it does but to get there is not worth the time or the hassle. It is a tool for techies that love the command line, not for people like me who want to get a job done without having to have a 'computer science degree'.

  • #2
    judgedredd,
    I searched and found numerous solutions to "install ImageMagick on Windows XP" and found "About 202,000 results (0.41 seconds)" The Internet searches are becoming far too clever and it is not easy to sift the 'wheat from the chaff' to find an ideal solution... meanwhile a lot of valuable time is wasted but hopefully something was learnt during the trial and error processing

    In the good old days I used to use Windows 3.1 and subsequent versions until I started web programming. The thought soon occurred about the difficulties of using a Window operating system to upload to a different onlne operating system! After trying several Linux Operating Systems I now have an identical local and remote operating systems.

    Linux has a "Ubuntu Software" utility that installs by clicking on a button Did you search for a similar utility on Linux Mint 18.3? See attached image for the Ubuntu Software Search:

    I don't have a 'computer science degree` and agree that the ImageMagick documentation is not easy to follow, far easier to search for solutions.

    As mentioned in the previous thread using the "ImageMagick mogrify" command reduces ten image file sizes from 7.4Mb to 2.3MB with the same image dimensions. Further reductions in size are recommended to a mximum of about 1024px which is another simple task.

    Perhaps spend an hour per day to learn Linux and to find alternative Windows programs. I'm sure the time spent will be rewarded in a very short while.
    Attached Files
    Last edited by John_Betong; Mar 18, 2022, 02:59 AM.

    Comment


    • #3
      John_Betong , doing searches brings up another issue - using the correct nomenclature. I did try looking for info on how to install imagemagick on XP but found a lot of them not very good. The worse thing is the absolutely appalling rendering of pages. Many of these sites have tons of awful ads that take up screen space and cause the page to take ages to load (probably due to the code finding that its an XP machine trying to view the page). On top of that very few articles are by people who actually own the sites so they tend to be on sites where many contribute with the result that the actual owners of the sites use bootcrap/wordpress/wix and other crap like that. Wix and Squarespace, and to a lesser degree Wordpress, now prevent 'older' browsers/OSes from accessing their sites even though the browser I use is fully HTML5 and CSS3 compliant.

      Anyway, I have been using my Linux Mint partition a helluva lot more these last few weeks than I ever have in the last 10 years! That's how difficult it is becoming to navigate the web.

      Comment


      • #4
        judgedredd,
        I was curious about the LinuxMint problems so downloaded and installed onto a thumbdrive then rebooted to the thumbdrive.

        It appears that LinuxMint uses the " Synaptic Package Manager" which is a graphical package,

        https://geek-university.com/synaptic/

        Open "Synaptic Package Manager", search for "imagemagick", "Mark for installation", "Apply"... job done

        Let me know what files conversions are required and I will try to supply the relevant Command line script.

        My knowledge of ImageMagick is limited and I would like to learn more especially considering it was first introduced 31 years ago!

        https://en.wikipedia.org/wiki/ImageMagick

        Comment


        • #5
          Hi John_Betong I installed Imagemagick by using the Synaptic manager - I actually seem to have two Imagemagick icons under graphics tools. Yet when I tried using the commands as given on the Imagemagick website the file sizes never changed - some of them actually icreased in size. The command that was given, after navigating into the folder where the images were was this:

          Code:
          magick convert *.jpg -scale50% -quality50
          That didn't work so I tried using this:
          Code:
          magick convert *.jpg -resize50% -quality50
          That didn't work so I tried using this:
          Code:
          convert *.jpg -resize50% -quality50
          That didn't work either so I got fed up and looked online for a solution which is where I came across the site I mentioned in my first post.

          After 31 years one would have thought that the developer would have made it dead easy to use by creating a GUI for users and making sure that it would work on most OSes. But obviously that was not his priority. Typical.

          There are other programs out there that have been around for ever like Pegasus Mail, yet even though it has a GUI and I think very highly of that program it is quite complex to set up (with extra parameters for setting up the mail servers that other programs don't have, which make it more complicated to set up than it should be) and I have never used it after trying it out a long time ago.

          Resizing of images is the single most important thing any web developer can do nowadays for his or her site due to digital cameras hitting image sizes of 4-20MB or more as per the article that VIPStephan posted and for there not to be a program that is NOT complicated to use, and does that one job with a batch process available is what is needed. Imagemagick is not that prorgram as it does a lot of other things that I do not need.
          Last edited by judgedredd; Mar 19, 2022, 10:11 AM.

          Comment


          • #6
            judgedredd,
            Please explain exactly from where your copied the conversion scripts.

            Also can you explain what you are trying to do?

            To convert to .webP fromat try the following:

            Command line:
            Code:
             mogrify -format webp *.jpg
            Edit:
            I tried the commands you supplied and these are the results:
            Code:
            $ magick convert *.jpg -scale50% -quality50
            Command 'magick' not found, did you mean:
            command 'magic' from deb magic (8.3.105+ds.1-1)
            command 'magics' from deb magics++ (4.8.0-1)
            Try: sudo apt install <deb name>
            $
            $
            $ magick convert *.jpg -resize50% -quality50
            Command 'magick' not found, did you mean:
            command 'magics' from deb magics++ (4.8.0-1)
            command 'magic' from deb magic (8.3.105+ds.1-1)
            Try: sudo apt install <deb name>
            $
            $
            convert *.jpg -resize50% -quality50
            convert-im6.q16: unrecognized option `-resize50%' 
            error/convert.c/ConvertImageCommand/2593.
            The convert command that works for me"
            Code:
            convert img-name.jpg -scale 50 -quality 50 DELETE-ME-002.jpg
            Last edited by John_Betong; Mar 19, 2022, 03:33 AM.

            Comment


            • #7
              John_Betong one of the sites I visited is this one: https://imagemagick.org/script/comma...processing.php
              On that page it had, a ways down the page, this command example:
              scale% Height and width both scaled by specified percentage.
              So obviously I took it to be scale50%. I even tried scale50. None of them worked. If what you used is -scale 50 THAT is what should have been written. i.e.
              -scale x (where x is the number to scale to) Height and width both scaled by specified percentage number [note: emphasis added]

              I have come across this idiotic example code writing sooooooo many times. These bloody programmers ASSUME things instead of taking the time to EXPLAIN in easy to understand and straight forward syntax.

              I then looked this stuff up on a duckduck search and there was a youtube video of someone doing this. They used the syntax given in my post #5. The URL of the video is: https://www.youtube.com/watch?v=HOu-84JCmHA

              Anyway, John, you don't have to spend anymore time on it. It is getting to be very annoying spending so much time on something I am not going to use. I have actually found a program that seems to do exactly what I want. Its called EasyImageSizer. Just downloaded it from Sourceforge here: https://sourceforge.net/projects/eas...files/windows/ - version 3-3.0.5 (THAT was an ordeal in itself!). I haven't given it a go yet, just been looking at the GUI. Its simple and easy to use. AND it works on XP. Thanks for trying to help on this.

              NOTE: I have just used EasyImageSizer to resize a folder of 84 images and it did the job in less than a minute. Avg size of original images 224K (2000px wide) - after setting resize parameters to 50% and quality to 32 it did the job really well with the avg size being 50K. So I will now be using this program to batch resize images from now on.
              Last edited by judgedredd; Mar 19, 2022, 04:12 AM.

              Comment


              • #8
                judgedredd,
                For my own benefit I created the following ImageMagick Conversions because I was curious to know of the different file sizes for identical sized images types - between jpg, gif, png and webP. The differences are startling and well worth noting:

                https://this-is-a-test-to-see-if-it-.../index-001.php

                Edit:

                I added loading="lazy" to the images, tested from my German Server and delighted with the following results:

                https://tools.pingdom.com/#5fe8640029400000

                Code:
                Performance grade A 94
                Page size    4.4 MB
                Load time    176 ms
                Requests    7
                Last edited by John_Betong; Mar 31, 2022, 08:59 PM.

                Comment


                • #9
                  The jpg size is impressive!

                  Comment


                  • #10
                    Originally posted by judgedredd View Post
                    The jpg size is impressive!
                    I've just added the percentage reduction and wholeheartedly agree about being impressive. And don't forget the loading time

                    Originalfilesize(...): 2,886,216 bytes
                    Percentaqe reduction: 00.00%

                    convert 'C*.png' -scale 1024 -quality 42 CANCER-42.jpg
                    filesize(...): 49,965 bytes
                    Percentaqe reduction: 98.27%
                    I'm curious to know how the conversions compare with "EasyImageSizer?"

                    Edit:
                    Please note that if the filename contains spaces then ImageMagick file name MUST be within single of double quotes.
                    Last edited by John_Betong; Mar 19, 2022, 06:20 AM.

                    Comment


                    • #11
                      I took that same image and got it down to 45.3K! I set the % reduction at 35 and the quality at 42. So the size is 890 x 500. Here it is:

                      Click image for larger version  Name:	Cancer-laced-vaccines-final.jpg Views:	0 Size:	44.1 KB ID:	2435470
                      Doing a reduction of 40% gives dimensions of 1018 x 572 with similar quality.

                      Having compared your images with mine the quality of the Imagemagick images is clearly superior as can be seen in the black text. Yours looks really crisp - the same as the original, whereas mine has jagged edges.
                      Last edited by judgedredd; Mar 19, 2022, 09:41 AM.

                      Comment


                      • #12
                        I also went to http://bulkresizephotos.com and put in the same parameters - quality 42, resize 40.5% and got the size in at 49K. Far better quality than mine and similar to yours. Here it is:
                        Click image for larger version  Name:	Cancer-laced-vaccines-final-2.jpg Views:	1 Size:	49.0 KB ID:	2435472
                        Interesting results!

                        Comment


                        • #13
                          Originally posted by judgedredd View Post
                          I took that same image and got it down to 45.3K! I set the % reduction at 35 and the quality at 42. So the size is 890 x 500. Here it is:

                          Click image for larger version Name:	Cancer-laced-vaccines-final.jpg Views:	0 Size:	44.1 KB ID:	2435470
                          Doing a reduction of 40% gives dimensions of 1018 x 572 with similar quality.

                          Having compared your images with mine the quality of the Imagemagick images is clearly superior as can be seen in the black text. Yours looks really crisp - the same as the original, whereas mine has jagged edges.
                          I used the image width set at 1024 and instead of fixing the height let ImageMagick do the scaling.

                          in all the examples that I have seen the quality has been set to 50.

                          it is quick and easy to generate images, try varying width and quality and note the results.

                          The source code for the demo is available which will render the generated images.

                          have fun

                          Edit:
                          There are numerous other options which can be added. Perhaps try sharpness, gamma or some other options. My cataracts have difficulty in spotting the differences
                          Last edited by John_Betong; Mar 19, 2022, 09:58 AM.

                          Comment


                          • #14
                            Ok John_Betong , you say the source code for the demo is available. Where? In your post? How does one get one's server (as opposed to one's laptop) to do what you did? It'll be interesting to see what your instructions will be if any If you do post something don't assume that my server installation has Imagemagick installed by default (which I don't by the way - I just checked).
                            Last edited by judgedredd; Mar 19, 2022, 10:22 AM.

                            Comment


                            • #15
                              judgedredd,
                              the source code is toggle at the very bottom. The demo only renders the generated images and displays the file size and dimensions.

                              I have ImageMagick installed locally and upload to the server to display the results.

                              Comment

                              Working...
                              X