2
$\begingroup$

I have been working with a file from the USGS that is a heightmap of the Moon. I resized it to 65536 x 32768 px for use as a displacement map in Blender, and turned it into tiles. Then I created tiles from the original image and noticed that they were about a fifth of the file size of the ones from the resized image, even though they have twice the pixels. Image Magick had remapped the image using many tones of gray that weren't present in the original. Presumably this is why the files are now so much bigger.

Original histogram: enter image description here

Resized histogram: enter image description here

Is there any way I can resize this image without the process creating new gray tones?

$\endgroup$
7
  • $\begingroup$ I'm not sure this is the answer you want - but if you did the resize with a nearest-neighbor interpolation that should ensure no new colors. It will, however, result in a blocky displacement map, which I assume you don't want. $\endgroup$ Commented Jun 7, 2018 at 1:25
  • $\begingroup$ @user1118321 My understanding is that the way displacement maps work in Blender will smooth things naturally - and if not, that can be made to happen. Anyways, since information has been created that wasn't in the original, i see no reason not to find work-arounds instead of working with bloated files. So, i need to look into nearest-neighbor interpolation? Will Image Magick do that? $\endgroup$
    – kim holder
    Commented Jun 7, 2018 at 1:55
  • $\begingroup$ I've not used Image Magick, but from what I've read about it, it almost certainly does. $\endgroup$ Commented Jun 7, 2018 at 3:22
  • $\begingroup$ What image format are you using? JPEG can introduce quite a lot of unwanted colours. $\endgroup$
    – PaulHK
    Commented Jun 7, 2018 at 8:42
  • $\begingroup$ Tgey will smooth but if you use NN it is still blokier since the reconstruction filter would produce a different result. But since the result interpolates why would it matter to you? And why would a smaller file matter to blender? It would still need to expand the file to full memory footprint $\endgroup$
    – joojaa
    Commented Jun 7, 2018 at 13:42

1 Answer 1

2
$\begingroup$

A nearest-neighbor resize will do what you ask but I am not certain it will give you much smaller tiles.

It is quite likely that the tiles made from the original image are smaller simply because they have less high frequency content and thus compress far better.

You can look at it the other way around: there are more terrain features in the tiles of the resized image so it takes more space to store them. That's a very gross simplification of the truth, of course. And it assumes a reasonably efficient compression algorithm.

$\endgroup$
3
  • $\begingroup$ The size difference between the two tile sets isn't that huge - the tiles from the original image are 11,520 on a side, while the ones from the resized image are 8,192 on a side. I'm hopeful, but we'll see. $\endgroup$
    – kim holder
    Commented Jun 7, 2018 at 14:05
  • $\begingroup$ @kimholder that is a quite big difference once you square the numbers $\endgroup$
    – joojaa
    Commented Jun 7, 2018 at 14:08
  • $\begingroup$ @joojaa it's about double. If high frequency content cancelled out the smaller size, i'd be content. Right now the smaller files are 5x bigger. $\endgroup$
    – kim holder
    Commented Jun 7, 2018 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.