PDA

View Full Version : Joining a matrix of tiles to make digital map



camerart
03.12.2019, 05:49 PM
Hi,
I am able to make a map from an area of tiles, but this is very time consuming, and wonder if anyone has done it by using Command line and scripts using Irfanview.

Command line and scripts will be very difficult for me, as I have rarely used them, and then only with supervision.

The tiles I have are a matrix with a top number so all of the top horizontal row of tiles may be say '123', with the next row '124' and so on. I first make the top line by using search and panorama, which gives me a line.png. After doing this hundreds of times I would have save all of the lines down to the bottom. Now I would have to do the same with the rows, for hundreds of times, and once the vertical panorama is done, I would have a map of my county.

Would anyone show me how to automate it please?

Cheers, Camerart.

Bhikkhu Pesala
03.12.2019, 06:24 PM
Have you tried creating a contact sheet instead of a panorama?

I could see no command line option for that, but one can make a grid without gaps between the images. The hard part is getting the files in the right order (drag and drop in Thumbnails can be used instead of renaming), then calculating the right values to enter in the Contact Sheet dialogue.

camerart
03.12.2019, 11:36 PM
Have you tried creating a contact sheet instead of a panorama?

I could see no command line option for that, but one can make a grid without gaps between the images. The hard part is getting the files in the right order (drag and drop in Thumbnails can be used instead of renaming), then calculating the right values to enter in the Contact Sheet dialogue.


Hi B,
The end product of what I want, is one image of my county as a map, which will be a very big file.

Drag and drop perhaps thousands of files would be too time consuming, and I think a contact sheet has gaps between eac image, so no good.

Let me know that you understand what I do longhand please.

The top horizontal row, are string of images all named the same e,g, '123' I search the whole of the tiles, which are a matrix, for 123, and then join them into a long strip.

Next I have to repeat the process 100s of times, 124, 125 and so on. Then I join them vertically.

I imagine that any command file or scripts, would be a two part process.

C.

Bhikkhu Pesala
04.12.2019, 05:12 AM
Contact sheets do not have to have gaps.

camerart
04.12.2019, 08:19 AM
Contact sheets do not have to have gaps.

Hi B,
That sound ok to me.

Is it possible to make a contact sheet of all of the images in one go?

If so, how would I do it, with all the same number at the top, making one PNG or JPG image?
C

Bhikkhu Pesala
04.12.2019, 09:53 AM
I am not going to do the maths for you.

If the images are a x b pixels and there are 10 rows and 10 columns your contact sheet will need to be 10a x 10b pixels, with no gaps or margins.

camerart
04.12.2019, 05:21 PM
I am not going to do the maths for you.

If the images are a x b pixels and there are 10 rows and 10 columns your contact sheet will need to be 10a x 10b pixels, with no gaps or margins.

Hi B,

I got better result using 'contact sheet' but I can't get my images into the correct order, so the final image is jumbled.

I'm trying to figure out just what order they're in. If I search for [ *.PNG ] in the top folder, then choose Thumbnails, I get this matrix, before 'contact sheet.

Here's an image showing how they should join: Put the coloured stars together.

C.

Bhikkhu Pesala
04.12.2019, 05:27 PM
The images can be dragged into any desired order in the Thumbnails view. Then create the contact sheet. with the selected images.

camerart
04.12.2019, 08:55 PM
The images can be dragged into any desired order in the Thumbnails view. Then create the contact sheet. with the selected images.

Hi B,

As there may be >1,000,000 tiles, this would be too time consuming.

I'll try other forums, thanks for you help.
C

Bhikkhu Pesala
04.12.2019, 09:46 PM
How is this ever going to work?

How big are these images that you're joining? If 1,000 x 1,000 pixels, that is 1 Megapixel. An image of one million megapixels is not going to load in IrfanView. Even those high resolution NASA images are only 256 Megapixels.

camerart
04.12.2019, 10:14 PM
How is this ever going to work?

How big are these images that you're joining? If 1,000 x 1,000 pixels, that is 1 Megapixel. An image of one million megapixels is not going to load in IrfanView. Even those high resolution NASA images are only 256 Megapixels.

Hi B,

I don't know how, but I'm sure it can be done, people are doing it all of the time.

In my first message I asked for command line, or scripts, so perhaps it is done by compressing as it proceeds. The finished image of 1,00,000, images won't be megapixels, but much smaller.
Cheers, C.

Bhikkhu Pesala
05.12.2019, 06:04 AM
Pixels cannot be compressed. If you discard pixels you must lose resolution. PNG compression is pretty good, especially with images with few colours, which is likely to be the case with your (Google Map?) images. However, that reduces the size of the image on disk, not in memory. To reduce the RAM needed one can either reduce colour-depth or reduce resolution; either way one loses data.

How big are the images being joined together? If they are a typical screen shot, they may well be more than 1 Megapixel.

5690

Perhaps someone will pass by who is good at writing batch files, but first let's discover if your project is even feasible.

camerart
05.12.2019, 09:41 AM
Pixels cannot be compressed. If you discard pixels you must lose resolution. PNG compression is pretty good, especially with images with few colours, which is likely to be the case with your (Google Map?) images. However, that reduces the size of the image on disk, not in memory. To reduce the RAM needed one can either reduce colour-depth or reduce resolution; either way one loses data.

How big are the images being joined together? If they are a typical screen shot, they may well be more than 1 Megapixel.

5690

Perhaps someone will pass by who is good at writing batch files, but first let's discover if your project is even feasible.

Hi B,
I'm not so good at this sort of thing, and always need help for this sort of 'blockage' to my ideas.

As well as asking forums etc, I have a mate who's also trying. He's a bit more savvy, than me. I give him feedback as I get more information, and he says he's writing an algorithm? and I notice his explanation includes re-sizing plus some other 'clever' words.

I opened one image in Irfanview, then saved it as a JPG. Here it is:
C

Bhikkhu Pesala
05.12.2019, 10:27 AM
Even at 256 pixels, which is 16 squares to a megapixel, your final image will be 1 million/16 = 62,500 Megapixels. I think you're unlikely to succeed and will end up breaking your country into a thousand strips of 62.5 Megapixels.

Saving as JPG just reduces the quality and increases the file size for such images. Use PNG instead, it will be smaller on disk. By reducing the colours to 256 very little colour information is likely to be lost. The attached image is only 7.55 Kbytes on disk, although the same dimensions as your image, which is 12.15 Kbytes on disk.

5694

camerart
05.12.2019, 03:20 PM
Even at 256 pixels, which is 16 squares to a megapixel, your final image will be 1 million/16 = 62,500 Megapixels. I think you're unlikely to succeed and will end up breaking your country into a thousand strips of 62.5 Megapixels.

Saving as JPG just reduces the quality and increases the file size for such images. Use PNG instead, it will be smaller on disk. By reducing the colours to 256 very little colour information is likely to be lost. The attached image is only 7.55 Kbytes on disk, although the same dimensions as your image, which is 12.15 Kbytes on disk.

5694

Hi B,

Ok.

Let's see how my mate gets on.

Thanks, C.