This might be a giant stretch, but is it possible to combine two decals into one image? For example. if I have one image having the letter “a” and the other image is a background. Would it be possible to combine those two decals so I can send it as one in a webhook?
I’m thinking some image software has an api that would allow me to do this, but not 100% sure.
you should add some error handling but here is a script example
local HS = game:GetService("HttpService")
local Api_Url = "http://image-merger.herokuapp.com/api/v1.0/"
local Data = {
["foreground_url"] = "https://www.roblox.com/avatar-thumbnail/image?userId=430874503&width=150&height=150&format=png",
["background_url"] = "https://www.roblox.com/avatar-thumbnail/image?userId=458587978&width=150&height=150&format=png"
}
Data = HS:JSONEncode(Data)
local ReturnData = HS:PostAsync(Api_Url, Data)
if ReturnData ~= nil then
ReturnData = HS:JSONDecode(ReturnData)
print(ReturnData["output_image"]["url"])
end
I get the error, “Images were not found” everytime I run the script. Here’s what I added:
function GetImageUrl(player)
local Layout = player.PlayerGui.CustomBadges.Begin.Type.Value
local Image = player.PlayerGui.CustomBadges.Middle.Type.Value
local HS = game:GetService("HttpService")
local Api_Url = "http://image-merger.herokuapp.com/api/v1.0/"
local Data = {}
if Layout == 1 then
Data = {
["foreground_url"] = game:GetService("Players"):GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.AvatarThumbnail, Enum.ThumbnailSize.Size420x420),
["background_url"] = "https://www.roblox.com/asset-thumbnail/image?assetId="..Image.."&22&width=420&height=420&format=png"
}
elseif Layout == 2 then
Data = {
["foreground_url"] = game:GetService("Players"):GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.AvatarThumbnail, Enum.ThumbnailSize.Size420x420),
["background_url"] = "https://www.roblox.com/asset-thumbnail/image?assetId="..Image.."&22&width=420&height=420&format=png"
}
end
pcall(function()
Data = HS:JSONEncode(Data)
end)
local ReturnData
pcall(function()
ReturnData = HS:PostAsync(Api_Url, Data)
end)
if ReturnData ~= nil then
ReturnData = HS:JSONDecode(ReturnData)
return ReturnData["output_image"]["url"]
else
warn("No images were found.")
end
end