URL Image Loader

Game

Replace localhost:3000 to your own api url
ImageLoader.rbxm (3.9 KB)

API

const sharp = require('sharp');
const axios = require("axios");
const express = require("express")
const app = express();
app.get("/convertTo32",async (req,res) => {
    console.log(req.query.url)
    let response = await axios({
        url: req.query.url,
        responseType: 'arraybuffer'
    })
    let a = await sharp(response.data).resize(parseInt(req.query.x || "32"),parseInt(req.query.y || "32"))
    let json  = await a.raw().toBuffer({resolveWithObject: true});
    console.log(json)
     res.json(json)

})
app.listen(3000)
20 Likes

Can you tell a bit more about it? Like ho it works and how to use it. Thanks.

3 Likes
  • API Directory
    – index.js (API Code)

Make sure you installed NodeJS,NPM

Go to API Directory and run

npm i express sharp axios

Run the APi

node index.js
3 Likes

So how would I send a request to the server? Like lets say I want to load a image. What Roblox script would do that?

Theres only 1 script inside the model.

Would be so great, if it wasn’t public. Can’t imagine amount of bypasses people will use. This system is still looking great, however I can tell you some of the ways to update it (discord @dauser).

2 Likes

This resource probably goes against roblox’s tos as it bypasses roblox’s image moderation. In fact the only reason i see someone using this over uploading images directly to Roblox is to bypass moderation.

2 Likes

As you say, it might be bypass of TOS, however sometimes Roblox’s asset management is so bad that some people would develop something like this just because of pure rage.

I was forced to develop an asset manager which calls Roblox API to maintain my assets. For example, it is impossible to delete an animation or even archive it, so I can either replace the animation content with other animation, or rename it into something like [UNUSED].

Of course this still shouldn’t be allowed and this thread must be closed.

1 Like

Pretty sure this is against TOS, still pretty interesting though. I would take this down to avoid getting banned

1 Like
This is wrong

This obviously does not work in game as it requires access to localhost which isn’t allowed in a published game. This only works in studio, therefore it does not break TOS.

Please do not post the source code for these projects as these can be used to bypass moderation.
I’ve made a similar system myself and I did not absolutely give any source code whatsoever since it’s against ToS.

1 Like

One can take the code from this post, create their own API(which is pretty easy to do using free web-hosting services on the web), and use this in a live game.
I made a similar system myself and after some testing, it easily worked in a live game.

1 Like

It’s up to Roblox to moderate their games, if someone wants to post a resource with no intention of using it to bypass moderation they should be able to do that.

1 Like

Even if it didn’t violate any rule, it’s way too unoptimized to be used in any game.

Github lets you reroute your local ports to thier servers :man_shrugging:

2 Likes

Noone ever said it must be always hosted on your local machine. You can host this server on your public server (for example a VPS).

1 Like

True, but can be optimized by making an union of all parts and create a single mesh. Single mesh makes only one render call per frame.
This will eventually hang a thread for some time until it finishes the mesh.

Do you need SurfaceGUI Version.

local HttpService= game:GetService("HttpService")
local Players = game:GetService("Players")
function splitTableEveryN(originalTable, n)
	local result = {}
	local currentSubTable = {}

	for i, value in ipairs(originalTable) do
		table.insert(currentSubTable, value)

		if i % n == 0 then
			table.insert(result, currentSubTable)
			currentSubTable = {}
		end
	end

	if #currentSubTable > 0 then
		table.insert(result, currentSubTable)
	end

	return result
end
Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(message)
		workspace.Part.SurfaceGui:ClearAllChildren()
		local result = HttpService:GetAsync("{{Your API}}/convertTo32?url=" .. HttpService:UrlEncode(message))
		local parsed = HttpService:JSONDecode(result)
		local pixData = parsed.data.data
		local pixInfo = parsed.info
		-- pixInfo = Image Paresd Info
	
		local parsed = splitTableEveryN(pixData,3)
		-- parsed Info Should look like this {{R,G,B},{R,G,B}}
		local yOffset = 0
		local xOffset = 0
		local pixPart = workspace.PixelStart
		for i = 1,#parsed do
			local Frame = Instance.new("Frame")
			Frame.Size = UDim2.new(0,1,0,1)
			Frame.BackgroundColor3 = Color3.fromRGB(parsed[i][1],parsed[i][2],parsed[i][3])
			Frame.BorderSizePixel = 0
			Frame.Parent = workspace.Part.SurfaceGui
			Frame.Position = UDim2.new(0,xOffset,0,yOffset)
			if xOffset >= pixInfo.width then
				xOffset = 0
				yOffset += 1
			end
			xOffset += 1


		end
		local Hint = Instance.new("Hint")
		Hint.Text = "Rendered Image (" .. pixInfo.width .. "x" .. pixInfo.height .." )"
		Hint.Parent = workspace

	end)
end)

This can be used to bypass moderation, so please do add a warning to not bypass moderation

1 Like

n o b o d y will care about that even i added.

1 Like

well, you can use this to put in NSFW pictures

1 Like