I’d say the answer is pixel data that you would import from an outside source, because after doing some research I came to the conclusion that pixels cannot be accessed by Roblox Studio tools.
You can get the pixel color of any image using this function. local function GetPixel(Image, X, Y)
local X = math.clamp(math.floor(X), 1, Image.AbsoluteSize.X)
local Y = math.clamp(math.floor(Y), 1, Image.AbsoluteSize.Y)
local RawData = Image:GetImage()
return Color3.fromRGB(bit32.rshift(bit32.band(RawData[(Y - 1) * Image.AbsoluteSize.X + X], 0xFF000000), 24), bit32.rshift(bit32.band(RawData[(Y - 1) * Image.AbsoluteSize.X + X], 0x00FF0000), 16), bit32.rshift(bit32.band(RawData[(Y - 1) * Image.AbsoluteSize.X + X], 0x0000FF00), 8))
end
You can get the position of the mouse relative to the Image using this function. local function GetMousePosition(Image)
local Camera = workspace.CurrentCamera
local CFrame = Camera.CFrame
local MouseHit = Camera:WorldToScreenPoint(Mouse.Hit.p)
local ImageHit = Camera:WorldToScreenPoint(CFrame:PointToWorldSpace(Image.AbsolutePosition + Vector3.new(Image.AbsoluteSize.X / 2, Image.AbsoluteSize.Y / 2, 0)))
local MousePosition = MouseHit - ImageHit
MousePosition = Vector2.new(MousePosition.X, MousePosition.Y)
MousePosition = (MousePosition / Image.AbsoluteSize) + Vector2.new(0.5, 0.5)
return MousePosition
end
You can use both of these functions together to get the pixel color of a specific point relative to the mouse. Image = script.Parent.Image
local function OnMouseMove(Mouse)
local MousePosition = GetMousePosition(Image)
local PixelColor = GetPixel(Image, MousePosition.X, MousePosition.Y)
end
Hey, so your plugin looks really cool, but do you know how I can render everything normally, but have like one or two blocks pixelated whenever I look at them?