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

For anyone wanting a direct URL that’s valid with textures/image inputs ingame in realtime without needing to worry about LoadAsset, you can input this at the cost of image quality until they make an actual function for it

"https://www.roblox.com/asset-thumbnail/image?assetId="..DecalID.."&width=420&height=420&format=png"

Since it’s technically grabbing the thumbnail of the asset, it should work with model/audio/video/mesh/plugin thumbnails as well. Not really useful for needing to get an actual image ID for studio purposes but works pretty well for having players input decal IDs for custom images etc.

31 Likes

We still need this :frowning:

For example, I’d like to allow users to use their own decal in a game. There is no user-friendly way for someone to get the image ID from the decal ID. The average Roblox player wouldn’t know how to do this.

25 Likes

This is frustratingly annoying, this really needs to be a built in feature that works with other players assets as well so we don’t have to do some hacky workaround to get the imageID.

6 Likes

Bumping this again because I seriously need this for something right now.

(seriously, all image based assets (decals, shirts, pants etc.) create rbxmx files housing the image, how hard is it to add this?)

8 Likes

I agree this is necessary. I have several use cases for user selected images in my game. Most users have no clue how to get the image id, and Roblox only shows the Decal Id in their inventory. I currently use a proxy API and the assetdelivery API to retrieve the image id if decal id is supplied. This is costly since there’s a finite 500/min budget and forces me to rate-limit changes. Adding this method should be trivial.

Side note, it’d be great if we could also get properties or a method to get the width & height of an image for determining aspect ratios. I have to use HttpService to pull in the image data and parse for them. Not optimal at all when this info is known by the engine.

10 Likes

Bump

Bumping this thread because I’m running into an issue utilizing Open Cloud and external applications now with the inability to get image ids from decal asset ids.

I’m externally editing rbxmx files and directly inserting ids into models, however, I cannot use the decal asset ids, i have to use the decal image ids, which do not automatically get converted when the model is imported.

Using this for surface appearance importing automation.

Also on a side note, Open Cloud’s mesh upload does not allow you to directly get the mesh id either, you get given the model asset id because ‘fbx meshes’ are uploaded under the Models tab.

EDIT: yes I have looked through the Open Cloud APIs and available APIs in webpoints; they do not provide the image id directly and only provide the asset id.

3 Likes

Still needed feature. For a game I develop in which users are supposed to be able to put their own images in-game, currently we do not have any solution as all the potential solutions seem to be too hacky. It continually causes confusion for our players as the average player is not experienced enough with Roblox that they know that there is a difference between decals and images, and the process of having to get the image id from a decal yourself. And if I remember correctly, for a long time the only or the easiest way to upload something as just a generic image was to upload it as a decal through the website.
InsertService, as others have stated before, is inadequate because of the restrictions on the creators of an asset to be inserted into the game (why can’t this be disabled anyways?). Otherwise, the best solution appears to be either to use external Roblox API’s which are not accessible by a Roblox server and require an external server or proxy as Cuyler hinted at (because Roblox afaik prevents accessing any said APIs from a server even when they may provide better functionality than is available through lua APIs, and of course with more effort anyone can end up just using proxies anyway so it is a mystery why this is even the case), or trying to use the thumbnail image which will be low resolution and non-suitable for anything more than a small display or icon.

3 Likes

Could I ask what parameters you use for the decal asset id → image id?


1 Like

Bump.
I’m doing something very similar to spook here above with out of studio tools for my development team and the fact that there isn’t a simple to find API to convert asset id to image id is baffling me.
This is an absolute must have that should of been implemented yesterday.

I’ve had to use decals to to bulk import textures for surface materials in the past and that was a massive pain but was at least possible. I cant continue with my current task. I have wasted massive amounts of time. For a completely cloud based platform, I shouldn’t have to use hacky methods to do this even within roblox studio.

Sorry if this has come of a bit aggressive its not my intention to be a pain but this is a feature I’ve needed more than once and I’m not alone.
There needs to be a simple to use API to convert between all the different needed types of ids.
I didn’t expect something like this to be a roadblock when there are features in Roblox like surface appearance that only take certain id types.

1 Like

IIRC InsertService:LoadAsset can be used to get the image id from the decal id.

1 Like

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