safari raster color issue
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
mapbox-gl-js version: v3.4.0
browser: safari
**Steps to trigger behavior**
1. Load attached grayscale image as image layer.
2. colorize the image using the attached json with raster color array
**Screenshots**
Chrome (as expected)
Safari (bug)

original image
[rasterColor.json](https://github.com/user-attachments/files/15958910/rasterColor.json)
**Description**
I loaded the original image as image layer and user the attached raster color json file to generate raster color expression.
`let paint: mapboxgl.RasterPaint = {
"raster-opacity": 1,
"raster-resampling": "linear",
"raster-fade-duration": 0,
"raster-color": ["interpolate", ["linear"], ["raster-value"], ...colors],
"raster-emissive-strength": 1,
};
return [
{
id: this.id,
type: "raster",
source: this.id,
paint,
},
] as RasterLayer[];
}`
Contributor guide
Research direction
Start by reproducing the raster color expression from the issue with the attached original image and rasterColor.json in Safari, then compare it with Chrome. Trace the RasterPaint settings, especially raster-color and raster-value; done means the Safari rendering matches the expected Chrome colorization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100