I am trying to make a paint plugin. The user can select a image from the workspace and edit it in the plugin. I made this script but it did not do anything when i ran it:
local Image = game.workspace.ImageLabel.Image
local Binary = Image:GetBinaryContents()
print(Binary)
GetBinaryContents is a function of Files which have to be imported manually by the user using PromptImportFile(s). Unfortunately, you can’t edit the binary contents, just view them.
Oh, I thought you wanted to edit it within the plugin. My bad. You’ll still have to ask the user to import an image using StudioService, though, I don’t think you can get binary contents from a Roblox asset id directly. Alternatively, you might be able to get the raw contents at https://www.roblox.com/asset?id=IMAGE_ID_HERE, but I don’t know if those are the binary contents and you’d have to proxy the request.
You need a File object to get a temporary id. If you have a File object, you can just use GetBinaryContents on it. If you just have the Image’s on-site id (rbxassetid://whatever) then you don’t actually have the File and can’t get its contents at all. If you want a File object, you have to use PromptImportFiles like I said earlier.