White stripe on image when exporting

When exporting artboard to jpg, setting the size to, say, 3000w, a white stripe appears at the bottom in the exported image

Hey Sam,

Thanks for reporting this. Can you share a sample document to run some tests? I’ve just made two exports to JPG with 3000w, one is a bitmap image, the other is vector and the JPG exports are correct, I didn’t get a stripe.

I tested using the latest beta as well as Sketch 100.3

Thanks :pray:

On M1, Sketch 100.3
example.sketch (10.1 KB)

Hey Sam,

Thanks for the sample file. In this case, the line that appears on the export happens because of the initial size of your layer + the 3000w export setting.

The exported jpg will be 3000px wide and the height will be calculated. In this case, the layer’s height is 536, and with a 3000w setting, the calculated height for the export is 1968.17 , but exports do not support subpixel dimension values, so it’s rounded up and it results in a 3000 x 1969 image.

This extra space is filled with the colors from the image. The line appears white, but it’s a pale tone of gray, taken from the black color of the layer. The image below shows a detail of the exported jpg and a block filled with 100% white below.

One solution is to adjust your source layer’s dimensions so that dimensions are integer values. Another solution is exporting in integer multiples: 2x, 3x and so on.

Thanks for your answer. Should this only happen with the JPG format? Because I didn’t get subpixels in any of these PNG, TIFF, WEBP formats

Hi Sam,

My apologies for the delay in my reply.

This also happens with the other image formats, but the line is not noticeable because these formats: PNG, TIFF, and WEBP support transparency, so the extra line is still there, but it’s harder to see as it’s just 1px tall and it’s transparent

Here’s a detail of a PNG export: