Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Graphics
  4. Split one image into six smaller, component images.

Split one image into six smaller, component images.

Scheduled Pinned Locked Moved Graphics
questioncsharpphpcssdatabase
7 Posts 3 Posters 15 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Brady Kelly
    wrote on last edited by
    #1

    I have a deck of Elder Futhark rune cards I hand drew myself some 25 years ago. On a large paper card on a drawing board. Back then Google was the belated Messiah, and online services such as rune drawing or font composition where very scarce. I did it all my little old self with a T-square, ruler, pencil, and other such steam-punk devices. Having rediscovered the deck, I find the accuracy and attention to detail I put into each card remarkable; runes are drawn with black koki pens, on white card; the uniformity of line thickness close to perfect on most cards, and the points where lines meet have zero smudge or overlap, or whatever. These look, except for one or two, like they were printed. I want to capture all these cards for part of a digital work, and because the cards have aged some 25 years, their edges are not perfect, although each card is still a very good 80mm x 100mm. I scanned sets of six cards, in a grid style, on A4 paper, and used a white brush to remove edge markings and other unwanted spots from the cards. I now have six perfect enough composite images of 5670mm x 4730mm (3 cards wide, 2 deep on each image). These 'final' images are all nearly perfect size to be divided into 6 smaller images, that make up the large ones, So, from 5680mm wide, we get three cards 1890mm wide, and from 4739mm wide I get 2 2365mm cards. Now, how do I do this? Using a selection rectangle in Paint.NET is not for the feint of heart, and not much ambition for this task. I have done an incredibly lot of google research before asking here, but nearly all results advised I use the ImageMagic [^]`convert` command. I have tried several variants of the `convert` command to no avail, e.g. one gives a very small image out but still containing all six original images. Various other attempts here met with similarly strange results. The basic command I\m trying to use is: convert 'LargeImage.jpg' -resize 120x120 thumbnail%03d.png

    No object is so beautiful that, under certain conditions, it will not look ugly. - Oscar Wilde

    Richard DeemingR 1 Reply Last reply
    0
    • B Brady Kelly

      I have a deck of Elder Futhark rune cards I hand drew myself some 25 years ago. On a large paper card on a drawing board. Back then Google was the belated Messiah, and online services such as rune drawing or font composition where very scarce. I did it all my little old self with a T-square, ruler, pencil, and other such steam-punk devices. Having rediscovered the deck, I find the accuracy and attention to detail I put into each card remarkable; runes are drawn with black koki pens, on white card; the uniformity of line thickness close to perfect on most cards, and the points where lines meet have zero smudge or overlap, or whatever. These look, except for one or two, like they were printed. I want to capture all these cards for part of a digital work, and because the cards have aged some 25 years, their edges are not perfect, although each card is still a very good 80mm x 100mm. I scanned sets of six cards, in a grid style, on A4 paper, and used a white brush to remove edge markings and other unwanted spots from the cards. I now have six perfect enough composite images of 5670mm x 4730mm (3 cards wide, 2 deep on each image). These 'final' images are all nearly perfect size to be divided into 6 smaller images, that make up the large ones, So, from 5680mm wide, we get three cards 1890mm wide, and from 4739mm wide I get 2 2365mm cards. Now, how do I do this? Using a selection rectangle in Paint.NET is not for the feint of heart, and not much ambition for this task. I have done an incredibly lot of google research before asking here, but nearly all results advised I use the ImageMagic [^]`convert` command. I have tried several variants of the `convert` command to no avail, e.g. one gives a very small image out but still containing all six original images. Various other attempts here met with similarly strange results. The basic command I\m trying to use is: convert 'LargeImage.jpg' -resize 120x120 thumbnail%03d.png

      No object is so beautiful that, under certain conditions, it will not look ugly. - Oscar Wilde

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      Sounds like you're looking for the crop command[^]. :)

      -crop geometry{@}{!}[^]

      The width and height of the geometry argument give the size of the image that remains after cropping, and x and y in the offset (if present) gives the location of the top left corner of the cropped image with respect to the original image.


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      B 1 Reply Last reply
      0
      • Richard DeemingR Richard Deeming

        Sounds like you're looking for the crop command[^]. :)

        -crop geometry{@}{!}[^]

        The width and height of the geometry argument give the size of the image that remains after cropping, and x and y in the offset (if present) gives the location of the top left corner of the cropped image with respect to the original image.


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        B Offline
        B Offline
        Brady Kelly
        wrote on last edited by
        #3

        So I would effectively, on card at a time, crop the whole drawing down to one-card size, save that card size drawing under a new name, then recalculate the offset for the next card, 24 times. No great effort if I get the process right once to start with. Thanks.

        No object is so beautiful that, under certain conditions, it will not look ugly. - Oscar Wilde

        Richard DeemingR M 2 Replies Last reply
        0
        • B Brady Kelly

          So I would effectively, on card at a time, crop the whole drawing down to one-card size, save that card size drawing under a new name, then recalculate the offset for the next card, 24 times. No great effort if I get the process right once to start with. Thanks.

          No object is so beautiful that, under certain conditions, it will not look ugly. - Oscar Wilde

          Richard DeemingR Offline
          Richard DeemingR Offline
          Richard Deeming
          wrote on last edited by
          #4

          You should be able to do it with a single -crop command:

          -crop geometry{@}{!}[^]

          You can add the @ to the geometry argument to equally divide the image into the number of tiles generated.

          convert -crop 120x120 LargeImage.jpg tiles/tile%03d.jpg


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

          1 Reply Last reply
          0
          • B Brady Kelly

            So I would effectively, on card at a time, crop the whole drawing down to one-card size, save that card size drawing under a new name, then recalculate the offset for the next card, 24 times. No great effort if I get the process right once to start with. Thanks.

            No object is so beautiful that, under certain conditions, it will not look ugly. - Oscar Wilde

            M Offline
            M Offline
            Manfred Rudolf Bihy
            wrote on last edited by
            #5

            Here's a link to the ImageMagick documentation for the crop command. From a quick look it will do exactly what you want. Link added: http://www.imagemagick.org/Usage/crop/[^] Cheers!

            "I had the right to remain silent, but I didn't have the ability!"

            Ron White, Comedian

            B 1 Reply Last reply
            0
            • M Manfred Rudolf Bihy

              Here's a link to the ImageMagick documentation for the crop command. From a quick look it will do exactly what you want. Link added: http://www.imagemagick.org/Usage/crop/[^] Cheers!

              "I had the right to remain silent, but I didn't have the ability!"

              Ron White, Comedian

              B Offline
              B Offline
              Brady Kelly
              wrote on last edited by
              #6

              What link? :confused:

              No object is so beautiful that, under certain conditions, it will not look ugly. - Oscar Wilde

              M 1 Reply Last reply
              0
              • B Brady Kelly

                What link? :confused:

                No object is so beautiful that, under certain conditions, it will not look ugly. - Oscar Wilde

                M Offline
                M Offline
                Manfred Rudolf Bihy
                wrote on last edited by
                #7

                Sorry, I added the link! Our office is out of coffee and I just came back from a three week vacation. Now where's that switch to turn my brain back on? :-D Cheers!

                "I had the right to remain silent, but I didn't have the ability!"

                Ron White, Comedian

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups