Skip to content

Singleband Gray Shader should create 32 bit values not just 16 bit #64560

Description

@RAB-Software

What is the bug or the crash?

Hi, I tried to export 32 bit height images from the Singleband Gray shader via a pyton script. I can export an image in 32 bit but the height data values stored in it are always reduced to 16 bit values. I expected them to be 32 bit. Is this by design or a bug? Is it possible to change the shader to create 32 bit values?

I calculated a normal map from the exported 32 bit image and always got terracing effects in the normal map - which is a hint to a 16 bit reduction of the data (see image below).

Image

My workaround for this export issue is to create 3 Hillshade renderers (here we only need save 8 bit per channel) to create the normal map manually. But this is uncomftable because the Hillshade shader is creating some errors. Looks like the shader is subtiling the pixels (Resolution per tile is 4096x4096) at 2000 x 2000 pixels per tiles. Those lines are only to be seen when saving the image - on screen there is everything clear (seems to be a post effect hiding the lines). So this is the second bug I found with my workaround workflow.

Image

Thanks for your reply & kind regards.

Steps to reproduce the issue

Save 32 bit image problem:

  • Load an 32 bit height image
  • chose SingleBand Gray Shader in Layer Styling
  • Run the script to save the 32 bit image

Resulting image contains only 16 bit height data in an 32 bit image file.

saveImageScript.txt

Hillshade Problem:

  • create an Hillshde of 32 bit height data (bigger than 2000 x 2000 Pixels)
  • set Altitude to 0, Azimuth to 0
  • choose fitting z-factor
  • save the image with the script above or use the export image function for the layer

There shold be black lines all 2000 pixels.

Versions

tested with 3.44.5-Solothurn and 3.32.0 Lima

QGIS version3.44.5-Solothurn
QGIS code revision5c593399236
 
Libraries
Qt version6.8.1
Python version3.12.12
GDAL version3.12.0 — Chicoutimi
PROJ version9.7.0
EPSG Registry database versionv12.022 (2025-08-30)
GEOS version3.13.1-CAPI-1.19.2
SQLite version3.50.4
PDAL version2.9.0
PostgreSQL client version17.3
SpatiaLite version5.1.0
QWT version6.3.0
QScintilla2 version2.14.1
OS versionWindows 10 Version 22H2
 
Active Python plugins
processing_saga_nextgen1.1.0
db_manager0.1.20
grassprovider2.12.99
MetaSearch0.3.6
processing2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugEither a bug report, or a bug fix. Let's hope for the latter!RastersRelated to general raster layer handling (not specific data formats)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions