# Premultiplied Alpha in Grayscale Images From GraphicsContext

**URL:** https://community.aseprite.org/t/premultiplied-alpha-in-grayscale-images-from-graphicscontext/24889
**Category:** Bug Reports
**Created:** [March 7, 2025, 9:08pm UTC](https://community.aseprite.org/t/premultiplied-alpha-in-grayscale-images-from-graphicscontext/24889 "2025-03-07T21:08:02Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![behreandtjeremy](https://community.aseprite.org/user_avatar/community.aseprite.org/behreandtjeremy/32/6606_2.png) [@behreandtjeremy](https://community.aseprite.org/u/behreandtjeremy)
#### Post date: [March 7, 2025, 9:08pm UTC](https://community.aseprite.org/t/premultiplied-alpha-in-grayscale-images-from-graphicscontext/24889/1 "2025-03-07T21:08:03Z")

</div>

This is relevant to the current beta at time of writing. I’m using version 1.3.14-beta1. If an [Image](https://github.com/aseprite/api/blob/main/api/image.md) is created in the gray [ColorMode](https://github.com/aseprite/api/blob/main/api/colormode.md), then its [GraphicsContext](https://github.com/aseprite/api/blob/main/api/graphicscontext.md) is used to draw some [antialiased](https://github.com/aseprite/api/blob/main/api/graphicscontext.md#graphicscontextantialias) shapes, there is a dark halo around the shapes’ edges.

 ![image](https://community.aseprite.org/uploads/default/original/3X/f/3/f3656b972f8943964eda7386e16fc007c920f971.png)

This does not seem to be a problem with RGB color mode.

 ![image](https://community.aseprite.org/uploads/default/original/3X/6/6/66022080785efdb72a8362f18ced37709eb36a71.png)

As a workaround, I wrote a Lua script method to loop through the image pixels and divide the gray value by the alpha. However, the fast version which sticks to integer math results in variation in the values.

 ![image](https://community.aseprite.org/uploads/default/original/3X/3/8/38067cf46e980e9638e9ea57861eec11f43310ca.png)

Above, `0x8b` varies with `0x8c`.
