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

<p>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.</p>

<p>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.</p>

CC BY-SA 4.0
2018-06-07T14:05:49.433Z
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.
kim holder
CC BY-SA 4.0
2018-06-07T14:08:55.753Z
@kimholder that is a quite big difference once you square the numbers
joojaa
CC BY-SA 4.0
2018-06-07T14:13:01.190Z
@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.
kim holder
CC BY-SA 4.0
2018-06-07T01:58:43.927Z
2018-06-07T01:58:43.927Z
Olivier
<p>I have been working with a <a href="https://astrogeology.usgs.gov/search/map/Moon/LRO/LOLA/Lunar_LRO_LOLA_Global_LDEM_118m_Mar2014" rel="nofollow noreferrer">file from the USGS</a> 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.</p>
<p>Original histogram:
<a href="https://i.sstatic.net/pkN30.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pkN30.png" alt="enter image description here" /></a></p>
<p>Resized histogram:
<a href="https://i.sstatic.net/eYqMu.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/eYqMu.png" alt="enter image description here" /></a></p>
<p>Is there any way I can resize this image without the process creating new gray tones?</p>

CC BY-SA 4.0
2018-06-07T01:25:19.047Z
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.
user1118321
CC BY-SA 4.0
2018-06-07T01:55:48.873Z
@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?
kim holder
CC BY-SA 4.0
2018-06-07T03:22:55.547Z
I've not used Image Magick, but from what I've read about it, it almost certainly does.
user1118321
CC BY-SA 4.0
2018-06-07T08:42:13.127Z
What image format are you using? JPEG can introduce quite a lot of unwanted colours.
PaulHK
CC BY-SA 4.0
2018-06-07T13:42:45.063Z
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
joojaa
CC BY-SA 4.0
2018-06-07T13:55:32.400Z
@joojaa this is for essentially a game. It will be downloaded many times so the bandwidth matters.
kim holder
CC BY-SA 4.0
2018-06-07T13:56:42.563Z
@PaulHK 16-bit PNG
kim holder
<color-management>
Is there a way to resize an image without creating new colors in the output image?
kim holder
# Is there a way to resize an image without creating new colors in the output image?

(Asked by: username_0 on 2018-06-06)

I have been working with a [file from the USGS](https://astrogeology.usgs.gov/search/map/Moon/LRO/LOLA/Lunar_LRO_LOLA_Global_LDEM_118m_Mar2014) 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](https://i.sstatic.net/pkN30.png)](https://i.sstatic.net/pkN30.png)

Resized histogram:
[![enter image description here](https://i.sstatic.net/eYqMu.png)](https://i.sstatic.net/eYqMu.png)

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

**Tags:** color-management

> **Comments:**
> **username_1**: 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.  
> **username_0**: @username_1 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?  
> **username_1**: I've not used Image Magick, but from what I've read about it, it almost certainly does.  
> **username_2**: What image format are you using? JPEG can introduce quite a lot of unwanted colours.  
> **username_3**: 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  
> **username_0**: @username_3 this is for essentially a game. It will be downloaded many times so the bandwidth matters.  
> **username_0**: @username_2 16-bit PNG  

---

## 1 answers

### Answer by username_4 on 2018-06-07. Score: 2 | Accepted answer

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.

> **Comments:**
> **username_0**: 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.  
> **username_3**: @username_0 that is a quite big difference once you square the numbers  
> **username_0**: @username_3 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.  

---

