Image Sequence

2008-12-11
2013-03-27
  • philippe sekine

    philippe sekine - 2008-12-11

    Hi,

    I am trying to take an image and output several different sizes. I can't seem to get the -write or + write operations to work correctly. Does anyone have an example of this operator to output different images?

    On a somewhat related note, is it possible to create a mask equivalent to the following imagemagick command since graphics magick doesn't support the clone operator? I can't imagine I'm the only one who likes rounded corners on their images.

      convert thumbnail.gif \      \( +clone  -threshold -1 \         -draw 'fill black polygon 0,0 0,15 15,0 fill white circle 15,15 15,0' \         \( +clone -flip \) -compose Multiply -composite \         \( +clone -flop \) -compose Multiply -composite \      \) +matte -compose CopyOpacity -composite  rounded_corners.png

     
    • Bob Friesenhahn

      Bob Friesenhahn - 2008-12-11

      Regarding -write and +write, I have never used these before.  I see that -write works but that the command line parser is broken for +write.  Now that my attention is drawn to it, I should fix it.

      Regarding the challenging command line, GraphicsMagick has not altered its command line behavior to support such complex syntax like ImageMagick 6 has. Alternatives are to explore use of MSL/conjure (XML style language) or use a scripting language like PerlMagick, TclMagick, or RMagick which allow more freedom than any command line.

      Yet another alternative is to explore the -draw command further.  Not many people are aware that it is actually quite powerful and supports operations like rotations and composition.

      Bob

       
      • Bob Friesenhahn

        Bob Friesenhahn - 2008-12-12

        I have decided that I should not give up on this issue so I am still looking at it.

         
    • Bob Friesenhahn

      Bob Friesenhahn - 2008-12-11

      It seems that -write and +write can not be properly functional in GraphicsMagick without substantially changing how arguments are processed so that they are like ImageMagick 6 (i.e. execute command line only in the listed order).  The problem is that GraphicsMagick accumulates the commands separate from the input images in order to make things intuitive to the user.  With some minor modifications I am able to get this much working:

      gm convert -monitor seaworld.miff -rotate 90 -write crap1.miff +write crap2.miff
        100% [seaworld.miff] Loading image...
        100% [seaworld.miff] Rotate image 90 degrees...
        100% [crap1.miff] Saving image...
        100% [crap2.miff] Saving image...

      but if an attempt is made to add additional commands after +write it does not work since the commands are all inserted after the input image name and so things fail:

      gm convert -monitor seaworld.miff -rotate 90 -write crap1.miff +write -rotate 180 crap2.miff
        100% [seaworld.miff] Loading image...
        100% [seaworld.miff] Rotate image 90 degrees...
        100% [seaworld.miff] Rotate image 180 degrees...
        100% [crap1.miff] Saving image...
        100% [crap2.miff] Saving image...
      gm ~/gm16 convert -monitor seaworld.miff -rotate 90 -write crap1.miff +write -rotate 180 -write crap2.miff +write crap3.miff
        100% [seaworld.miff] Loading image...
        100% [seaworld.miff] Rotate image 90 degrees...
        100% [seaworld.miff] Rotate image 180 degrees...
        100% [crap1.miff] Saving image...
        100% [crap2.miff] Saving image...
      Assertion failed: blob_info != (BlobInfo *) NULL, file /home/bfriesen/src/graphics/GraphicsMagick-head/magick/blob.c, line 1087, function DetachBlob

      Bob

       
    • Bob Friesenhahn

      Bob Friesenhahn - 2008-12-12

      This functionality (the +write part) is supposed to be in
      GraphicsMagick (presumably inherited from ImageMagick) but it was obviously never actually completed:

           -write <filename>
                write  an image sequence [convert, composite]

                The image sequence following the -write  filenameoption
                is  written out, and then processing continues with the
                same image in its current state if there are additional
                options.   To  restore  the image to its original state
                after writing it, use the +write filename option.

      Based on the above, do you expect:

        a) +write to only undo possible implicit alterations caused by -write (e.g.
      automatic conversion to grayscale or pseudoclass),

        or

        b) to undo any explicit or implicit alterations since the image was
      read (re-wind all the way to start),

        or

        c) to undo any explicit or implicit alterations since the image was
      originally read, or since a preceding "unwound" -write?

      Thanks,

      Bob

       
    • Bob Friesenhahn

      Bob Friesenhahn - 2008-12-13

      The next release of GraphicsMagick will have -write fixed in a useful way.  For example:

      %gm convert -monitor ~/seaworld.jpg -resize 50% -write crap1.pbm -resize 50% -write crap2.jpg -resize 50% crap3.jpg
        100% [/home/bfriesen/seaworld.jpg] Loading image...
        100% [/home/bfriesen/seaworld.jpg] Resize image...
        100% [crap1.pbm] Saving image...
        100% [/home/bfriesen/seaworld.jpg] Resize image...
        100% [crap2.jpg] Saving image...
        100% [/home/bfriesen/seaworld.jpg] Resize image...
        100% [crap3.jpg] Saving image...

      In this case each version written is 50% smaller than before.

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks