It's Impossible to Get an Image ID From a Decal ID

why do images and decals have separate asset types in the first place? i’ve never understood the necessity of having a dedicated asset type for decals, as they’re nothing more than images in the first place…

5 Likes

Decals and Images should just be merged together at this point. There’s no point in separating them.

6 Likes

This only works for certain assets, though, like those owned by Roblox or the place/group owner. In my case, players can use custom cursors, which third parties almost always own. This method would not work for me as it would throw out an “Asset is not trusted for this place” error.

Not externally accessible without having a studio open + localhost system implemented

Treating this like audio AssetIds seems to be an ideal start to me, with the same level of configurations offering public or private uploads and monetization the same.

Nope, not even, also you can’t access those externally like my post a little bit upward ;(

Update, there is a way to get it through asset delivery service but is not directly documented:

https://assetdelivery.roblox.com/v1/asset?id={asset_id}

for those doing it externally, you get the first “locations” url in the json data returned from the request and download the file at the location, this returns an XML file to which you get the id here:

(this works for meshes, however, you need a roblox cookie - see down below)

4 Likes

Update for meshes:

Same process as above, however, it returns an RBXM file (you have to add the extension manually).

NOTE: this request REQUIRES a roblox cookie that can access the assets to be present in the cookies.

This means for externally gaining the mesh id, you must parse the rbxm, find the target mesh part (so take it into studio first to see the structure of the import) and take the mesh id that way.

A parsing tool I’ve used is “rbxmk” @

Using this tool you can convert it to an rbxmx (xml format) and extract the meshid through reading the file’s content:

decompress rbxm / rbxl

# note: the rbxm has to be in the same directory as the rbxmk.exe
import os

FILE_DIRECTORY = os.path.dirname(os.path.realpath(__file__))
COMMAND = 'echo fs.write("{}", fs.read("{}")) | rbxmk run -'

def to_rbxmx( input_filename : str, output_filename : str ) -> None:
    process = subprocess.Popen(COMMAND.format(output_filename, input_filename), shell=True, cwd=FILE_DIRECTORY)
    process.wait()

to_rbxmx( "the_downloaded_file_filename_xdddd.rbxm", "output_filename_xdddd.rbxmx" )
# if the above does not raise an exception, it was successful
2 Likes

We really need a feature to get the Image Id from Decal Id… bumping this

1 Like

For those wanted more of a code sample of what you would do

ASSET_DELIVERY_API = "https://assetdelivery.roblox.com/v2/asset?id={}"

-- pull_mesh_id_from_rblx_xml is using ElementTree from the xml package + recursive loops with tag checks

2024, we have EditableImage now, but still don’t have this. Still needed. Would be nice if we could see the original size too, currently possible only in Studio.

3 Likes

Still waiting for that AssetService function roblox…

1 Like

Trying to currently make a sticker script that allows users to put their own decals in, and basing it off the spraycan tool on the catalog.

Turns out that won’t work as the spraycan tool used a very hacky old method to get the image: simply subtracting 1 from the decal.
This was made at a time when Roblox didn’t have bots mass creating clothing, so a decals image would naturally be the ID immediately before it, but now with assets being created at the speed of the Roblox servers, image IDs are usually a random amount behind the decal. Could be 5, could be 20, at worst I’ve seen them be beyond 50 IDs down.

Having a proper function or API that exposed something studio does automatically for you would be significantly appreciated as, to my knowledge, there is no non-hacky method to get an image from a decal (as I’d rather not do janky stuff like creating a decal instance for the sole purpose of getting an ID and then removing it, or putting in paragraphs of code poking to multiple likely ratelimited APIs just for a few numbers)

And no, the code you provided is objectively useless as loadasset straight up refuses to do anything unless you own or created the decal in question.
image

1 Like

The thing is, all decals (and other images for that matter) are just RBXMX documents with the ID inside them, I cant imagine this is that difficult to do even if a web proxy fetching the XML document was used.

If they moved to the binary format, I made LXM for that I guess?

Astonishing that we still have to ask players to “Keep subtracting one until you get the Image ID and then paste it in the box to display your decal!” When it can take up to 50 subtractions+ to get there. There should have been an API for this years ago, or just do away with decals entirely, what’s their purpose if you need the image ID to actually display them anyways?

1 Like

do we still not have a method for this??? this is insane

3 Likes

This is a long overdue feature request that needs to be resolved.
Users have voiced their opinions for years on why this is needed.

3 Likes

Can not find any working workaround… Does anyone have any news?

InsertService now supports loading public decals, making it possible to get an image ID from a decal ID with the sample code linked below!

4 Likes

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