Stop EditableImage Bleeding Colours

Hello!
I barely touch Roblox Studio nowadays, but lately I have been playing around with the EditableImage (which I have done previously), however one problem which I am unable wrap my head around are the bleeding colours.

Here are some examples of what the bleeding looks like (in different scenarios):


Screenshot 2025-05-07 183958
Screenshot 2025-05-07 184025

Here comes the code for the first image:

Which is a normal script parented to an ImageLabel, and with a RunContext of client

local AssetService = game:GetService("AssetService");

local ImageLabel   = script.Parent;
local Image        = AssetService:CreateEditableImage({Size = ImageLabel.AbsoluteSize});
local Buf          = buffer.create(Image.Size.X*Image.Size.Y*4);

local ByteCount = 0;
local Row       = 0;
local Col       = 0;

while(ByteCount < buffer.len(Buf)) do
        
        local Colour = (Row > 24) and Color3.new(1,0,0) or Color3.new(0,1,0);
        
        buffer.writeu8(Buf, ByteCount+0, Colour.R*255);
        buffer.writeu8(Buf, ByteCount+1, Colour.G*255);
        buffer.writeu8(Buf, ByteCount+2, 0);
        buffer.writeu8(Buf, ByteCount+3, 255);
        
        Col += 1;
        ByteCount += 4;
        
        if(Col == Image.Size.X) then Col = 0; Row += 1; end
end

ImageLabel.ImageContent = Content.fromObject(Image);
Image:WritePixelsBuffer(Vector2.zero, Image.Size, Buf);

I want to tear myself apart, this driving me insane…

2 Likes

I believe this is happening because the ImageLabel is using bilinear filtering

When the ImageLabel is drawn larger (or at an angle on a SurfaceGui) the engine averages neighbouring pixels, so the sharp red/green edge turns into the muddy gradient you saw

I believe setting your image labels resample mode to Pixelated should fix this, add it to the top of your script right after you define ImageLabel

ImageLabel.ResampleMode = Enum.ResamplerMode.Pixelated

Let me know if this fixes it

5 Likes

Thank you, that muddy mess was killing me : - )
Screenshot 2025-05-07 215445

4 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.