Image on right is with current master (and has the problem of a single pixel gray border line). Image on right is using an older Mapnik 2.1-pre - whatever version is included in TileMill 0.9.1.
downstream report: http://support.mapbox.com/discussions/tilemill/1514-tilemill-shows-black-lines-around-raster-layers
See also #1369
Looks like I can workaround by avoiding premultiplying the input raster (which also avoids darkening when using bilinear scaling). No other methods I found can workaround it.
diff --git a/src/agg/process_raster_symbolizer.cpp b/src/agg/process_raster_symbolizer.cpp
index ec4fdc9..a5acf45 100644
@@ -93,7 +93,7 @@ void agg_renderer<T>::process(raster_symbolizer const& sym,
- composite(current_buffer_->data(), target.data_, sym.comp_op(), sym.get_opacity(), start_x, start_y, true);
+ composite(current_buffer_->data(), target.data_, sym.comp_op(), sym.get_opacity(), start_x, start_y, false);
add failing testcase for #1471 (expected image generated with patch f…
…rom #1471 that disables premultiplication of data raster before blending)
add source tif for #1471 testcase
Just added a testcase that compares current output to what I think should be expected (or nearly) which is achievable by applying the above patch. To recap - I've also tried adding/removing ceil calls for start_* and end_* in src/agg/process_raster_symbolizer.cpp - but changing those just moves the problem gray lines around (from the left side to the right). The only thing that removes them altogether (and avoids them when using bilinear scaling (and I assume others)) is avoiding the premultiplication - which seems odd (and not the right solution) so needs a deeper look.
raster scaling issue
+ fix rasterizer polygon to be equal to target image
+ align raster to pixel bouyndaries (?)
( fixes grey border issue - #1471)
@springmeyer - see 8cb2ce4 - It should fix 'grey' border issue
@springmeyer - another approach would be to pre-initialise target buffer with 'master' (background) buffer values.
8cb2ce4 looks great. Also checked tile alignment (for this test case) is good enough:
The red circle highlights one place where pixels are visibly not perfectly aligned, but only at extremely high zoom levels, so I think this is more than good enough (if this is the poorest visible alignment):
finish fixing pixel alignment for raster rendering in cairo - closes #…
fix reference raster images after fixing edge effects as per #1471