Urgent.News

What's breaking now, across thousands of outlets.

Tech

My filter preview looked perfect. The export had seams.

The preview looked flawless. A soft vintage filter across a 6000px poster, edges clean, the gradient smooth all the way down. Then I exported, opened the PNG at 100%, and there were faint vertical seams running through the image — thin bands where the tone shifted by a hair. The preview had never shown them. That gap between what you see and what you get turns out to be a consequence of how a…

The preview of a 6000px poster with a soft vintage filter looked flawless. However, upon exporting the PNG and viewing it at 100%, faint vertical seams appeared. These thin bands of shifted tone were not visible in the preview. This discrepancy between the preview and the exported file occurred due to the limitations of rendering high-resolution images in a browser.

The canvas editor, which operates entirely in the browser, faces memory constraints. To maintain performance, the preview is rendered at a reduced resolution that fits the viewport, while the export recompiles the filter against the original full canvas. When a filter is applied, it runs against a downscaled buffer, resulting in a visually identical output at screen size.

The seams appear when the filter is recomposed against the original canvas at full resolution. The issue arises because filters with convolution kernels sample neighboring pixels, and if each processed band is isolated, the band edges show a mismatch in pixel sampling. To fix this, each band should be expanded with an overlap and then trimmed before stitching back together.

The preview does not require this overlap, which is why the seam only shows up during export. To verify this behavior, create a canvas at the intended export size, apply the filter, and export the result at 100% and 400% zoom. The preview is an optimization for fast interaction, while the exported file represents the final, accurate output.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Thursday 10 September →