Rasterize population image in grayscale

If you are allergic to bug trackers, you can post here any remarks, issues and potential bugs you encounter
Post Reply
OlegAlexander
Posts: 2
Joined: Fri Nov 04, 2022 10:57 pm

Rasterize population image in grayscale

Post by OlegAlexander »

Hello and thank you for creating CloudCompare!!

In the previous version of CloudCompare (Anoia), I was able to render a population image in grayscale. This made perfect sense as the intensity of a pixel is brighter where there are more points in a particular axis.

In the new version (Kyiv), something has changed, and now the population render has a color ramp applied to it. I believe the color ramp represents the height of the points?

I'd like the option to turn off the color ramp and go back to the pure grayscale render representing population only. I've attached two example images of a grayscale render from Anoia and the new color render from Kyiv.

As a temporary workaround in case there's no simple solution, could you please send me a link to the Anoia installer for Windows 64bit? Thank you!
Attachments
cc_population_kyiv_color.png
cc_population_kyiv_color.png (1.11 MiB) Viewed 2804 times
cc_population_anoia_grayscale.png
cc_population_anoia_grayscale.png (126.12 KiB) Viewed 2804 times
daniel
Site Admin
Posts: 7709
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Rasterize population image in grayscale

Post by daniel »

Are you referring to the 'cell population' layer of the Rasterize tool?

Because in this case, you can simply change the 'color ramp' of this scalar field (on the exported cloud) and set the Current Color Scale to 'Grey':
population_sf.JPG
population_sf.JPG (155.01 KiB) Viewed 2802 times
Daniel, CloudCompare admin
daniel
Site Admin
Posts: 7709
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Rasterize population image in grayscale

Post by daniel »

Anyway, here is the old 2.11.3 installer: https://www.cloudcompare.org/release/Cl ... up_x64.exe
Daniel, CloudCompare admin
OlegAlexander
Posts: 2
Joined: Fri Nov 04, 2022 10:57 pm

Re: Rasterize population image in grayscale

Post by OlegAlexander »

Thank you so much for your quick reply! After further investigation, I realized that I was wrong. Nothing has changed between Anoia and Kyiv with regards to the population/density raster image. Now I remember that I used a two step process to obtain the grayscale density image (example attached). Here's how:
  1. Export density GeoTiff from CloudCompare.
    1. Select the cloud and open the Rasterize tool.
    2. Set the step size and the direction axis.
    3. Update grid.
    4. Click the Raster button. In the export options, check only 'Export density (population per cell)'.
    5. Click OK and save the GeoTiff file with a .tif extension.
  2. Convert the GeoTiff file to a PNG.
    1. Open the tif file in Photoshop.
    2. Go to Image > Mode > 8 Bits/Channel
    3. Under the HDR toning options choose Method: Exposure and Gamma. Adjust the Exposure slider. Press OK.
    4. Optionally, go to Image > Adjustments > Invert to invert the colors.
    5. Save the image as a PNG file.
If you don't have Photoshop, you can use QGIS to convert the tif file to a png using the instructions here: https://gis.stackexchange.com/a/363919.

The reason I got confused this time around is because instead of pressing the Raster button in the Rasterize tool, I pressed the Image button. The Image button allows you to save a PNG directly, but it's not the same as the workflow I described above.

It would be ideal if the Rasterize tool allowed you to save an 8 bit grayscale density image as a png directly. The most straightforward way I can think of is by pressing the Raster button, selecting `'Export density (population per cell)', and having the option to save a png instead of a GeoTiff. Or an option to save a regular tif instead of a GeoTiff because not all image editors can open a GeoTiff but most can open a regular tif. Would that be possible?
Attachments
density_inverted_small.png
density_inverted_small.png (312.72 KiB) Viewed 2752 times
Post Reply