How to get image size from script?

I’ve spent hours trying to figure out how did roblox compressed my image, and how do I fit it perfectly into ImageRectSize but it is not perfect and my animation is wiggling.

I’ve scrolled through ImageLabel script in developer site for a very long time and I can’t find what I’m searching for.

The script should be placed in the image.
ClassName should be:

The script:

local ImageSize = script.Parent.Size
local ImageRectSize = script.Parent.ImageRectSize
local SizeTeller
SizeTeller ="Hint", workspace)
SizeTeller.Text = "Size of the image is: " .. tostring(ImageSize) .. " And image rect size is: " .. tostring(ImageRectSize)

Hope it helps!

How is this supposed to work?

I know image size on roblox screen, I know image size before putting it to roblox (in pixels) but I dont know how did roblox compressed my image, and how to create gif from spritesheet without unnecessary wiggling. Spritesheet 5x5 and I have to know size of the image in pixels to split it perfectly for an ImageRectSize frame.

Oh, I thought you wanted to see the image size through a text, Sorry, but i don’t know how to fix the same thing you’re trying to fix.