Туториал по редактируемым изображениям в Roblox Studio + БОНУС — Transcript
Full transcript
- 0:00you're looking at the animation you want
- 0:02to become like that you B of being 3D
- 0:06you want to become
- 0:092D but Isn't that cool you're generating
- 0:12your only
- 0:13W that you can run and it looks very
- 0:16cool and it took amazing 1 millisecond
- 0:19to
- 0:20generate it became a little bit better
- 0:23to draw but it can be more optimized at
- 0:25the end I'm getting this small beautiful
- 0:28image hi if you want to generate an
- 0:30image create a mini map for example V
- 0:32effects or to play a video Welcome to
- 0:34the tutorial today we're going to
- 0:36explore the editable image first before
- 0:38that let's talk about the properties of
- 0:40the editable image the maximum size is
- 0:421,24 by 1,24 if it's bigger it's going
- 0:46to snap to that in order to write the
- 0:47pixels in the editable image remember
- 0:50that all pixels are located in only one
- 0:53table and for each pixels there are four
- 0:55values and it goes like RGB Alpha RGB
- 0:59Alpha and so on so so on so on next one
- 1:01you can apply editable image almost to
- 1:04everything that has an image except of
- 1:06surface appearance and then once I said
- 1:08like the editable image is very very
- 1:10fast it is but it's not let me explain
- 1:13you why if you only write in the image
- 1:15it will be insanely fast like you can
- 1:17achieve 100 FPS 120 but if you generate
- 1:21the image it will be hell lot of slow to
- 1:23generate only one image on the big
- 1:26screen right maximum size 1,24 by 1,24
- 1:29it can take like up to a couple seconds
- 1:32but how we can fight with it how we can
- 1:34increase the speed of that for that I'm
- 1:36going to give you just a couple tips
- 1:39avoid something like Mass do Square
- 1:41rooting your functions avoid calling
- 1:43function for each pixel it will slow
- 1:45down the process okay let's start with
- 1:47the tutorial I'm going to turn off this
- 1:49annoying lamp you not going to see me
- 1:52very good but it's going to bur my eyes
- 1:54so today I'm going to switch the style a
- 1:56little bit how I make tutorials instead
- 1:58of just endlessly wri in the functions I
- 2:01prepared the whole place where you can
- 2:02go and look at the scripts and look what
- 2:04it do so the link to that place will be
- 2:06in the description and don't forget to
- 2:08enable the better feature editable
- 2:10images editable meses and at the end of
- 2:13this video there will be a small bonus
- 2:14for those people who want to compress
- 2:16videos and images here I prepared a lot
- 2:20of stance with different functions and a
- 2:23lot of the explanations if you for
- 2:25example open a script you can go to the
- 2:27stand decal and a script you see how
- 2:29heavily commented this so again link on
- 2:32the place in the description and let's
- 2:33start with the video before we go into
- 2:35any St let me show you the possibility
- 2:37of the editable image of course you can
- 2:39do this like without editable image but
- 2:41for tutorial we're going to do
- 2:42everything with it for this video I
- 2:44created like a small character that you
- 2:46can run as him as you see it is animated
- 2:50and it looks very cool first thing how
- 2:52to create an editable image so let's
- 2:54take a look at first two STS so I'm
- 2:56going to open the script every script
- 2:58you can find in the decal and the script
- 3:00first one is going to create an empty
- 3:02image so you just use instance. New
- 3:05editable Image and like in the case of
- 3:07the editable mesh if you paren this to
- 3:09the image object it will override the
- 3:11image so if you want to save every pixel
- 3:14of this amongus you have to use the
- 3:16asset service but instead of putting
- 3:17image object inside of this create
- 3:19editable image sync you put the texture
- 3:22of the image or just the link and then
- 3:23you parent this editable image to the
- 3:25image object let's take a look here's
- 3:27without asset service a press and amus
- 3:30has disappeared because editable image
- 3:32overwrites the existing image and with
- 3:34this I'm using the asset service if I
- 3:36press nothing happens because we saved
- 3:38the image and in the course of this
- 3:40tutorial we're going to create a drawing
- 3:42game a small drawing game for this we
- 3:44need to explore some basic functions
- 3:46let's open this stand the editable image
- 3:48has something like draw rectangle draw
- 3:50Circle draw a line we put the position
- 3:53in case of rectangle we put the start
- 3:55position and the color with transparency
- 3:57as well now the next one is draw Circle
- 3:59you just put the position of the circle
- 4:01radius of the circle as well color and
- 4:03transparency and the last one is draw
- 4:05line it has position one and position
- 4:08color and transparency as well so I'm
- 4:10going to press this button so it draw a
- 4:12circle yellow circle line as you see one
- 4:15pixel line and a rectangle so let's
- 4:17start with our drawing game for this we
- 4:18need a gii I already created a screen
- 4:20gii here we're going to create an image
- 4:23label for this because we need an object
- 4:25that has an image and we're going to use
- 4:26the maximum size of the editable image
- 4:28which is24 so I'm going to put the size
- 4:30of the image label here as you see it's
- 4:32totally gigantic but let me put on a
- 4:34test it is going to be 90/20 so let us
- 4:38Center that image as well some
- 4:39adjustments so first let's create a
- 4:41script in it we're going to create an
- 4:43editable image with instance and parent
- 4:46it to the image
- 4:48object and we're going to put the size
- 4:50of the editable image to
- 4:521024 okay that's going to overwrite our
- 4:55image next we need a mouse and the local
- 4:58player to draw the mouse is enough right
- 5:01but we're going to Define run Service as
- 5:03well okay next we're going to create the
- 5:06function that going to detect the mouse
- 5:08position on the canvas this we're going
- 5:09to use the absolute position of the
- 5:23object okay with that we first find the
- 5:27relative position to the canvas after
- 5:29this we multiply the scale by the
- 5:31editable image size that's because the
- 5:33editable image size can be very
- 5:35different and as well we're going to
- 5:37floor this Vector so let's rewrite a
- 5:39little
- 5:42bit then we need to detect if we
- 5:44pressing the
- 5:46button and as well let's do something
- 5:49with it so in our case we're going to
- 5:51draw a circle where we
- 5:58press and this transparency zero and now
- 6:00we need to connect this to the mouse
- 6:02click okay and the thing is we
- 6:04multiplied Mouse relative position but
- 6:07we need multiply Mouse relative scale in
- 6:09order to get the position okay and now
- 6:11we press run this and if you click you
- 6:14spawn the black sphere on the mouse
- 6:16position yeah but we want to draw with
- 6:18that so let's use run series for this we
- 6:21need to detect if we clicked or no and
- 6:23then if we clicked we're going to draw a
- 6:24circle so let's create a variable and
- 6:27let's record if we click the button or
- 6:29no
- 6:32okay uh then we don't need it here we're
- 6:35going to cut it with crl X then we're
- 6:37going to connect it to render step tent
- 6:40it is run service and let's connect T
- 6:42the function when we release the button
- 6:45in run service we're going to pass our
- 6:47script with mouse position we're going
- 6:49to get the mouse position and we're
- 6:51going to draw a circle and then we need
- 6:53to check if we pressing the button okay
- 6:56and let's test game as you see we drawn
- 6:58a circle if if we holding the left Mouse
- 7:01button but for some cases it's not
- 7:03enough when we move the mouse too fast
- 7:05we can of course use the FPS
- 7:08unlocker okay this FPS unlocker a little
- 7:11bit better but still not enough and for
- 7:13all case let's just draw a line if we
- 7:16hold the right Mouse button that we're
- 7:18going to detect the same thing and I'm
- 7:20going to change a couple
- 7:27things so if we press press the right
- 7:30Mouse button we're going to save the
- 7:32position of the mouse and then update it
- 7:34each frame like where it
- 7:39goes then if we release the button we're
- 7:41going to draw line from one position to
- 7:44another
- 7:49position and again if our Mouse is too
- 7:51far away we're going to snap that
- 7:53position back to our
- 7:57canvas and as well we're going to clear
- 8:00the variable Mouse
- 8:02position and yeah of course we need to
- 8:05disable our character because we cannot
- 8:06move the mouse and for now instead of
- 8:08disabling the character let's just
- 8:10instead of circles we're going to draw
- 8:12the lines so I'm going to use the button
- 8:14one button one and again let's just take
- 8:16the two if I hold my left Mouse button
- 8:20we can draw line from one place to
- 8:22another oh yeah and let's fix a couple
- 8:23things like this one and this one by the
- 8:25way here index starts with 0 0 not with
- 8:28one one it's not a regular lower table
- 8:31and to find out that you can look in the
- 8:33scripts in The Stance I somewhere put
- 8:35that in the comments so you can go and
- 8:37download the place okay we got our small
- 8:39drawing game but lines and circles it's
- 8:42not enough let's take a look how we can
- 8:43draw pixels for this we going to our
- 8:45next tent that will explain us how to
- 8:48write pixels if I open the scripts
- 8:50you're going to see something strange
- 8:51like throw utilities but for now let's
- 8:54just focus on how to write pixels so to
- 8:56write pixels to the image we can use
- 8:58editable image like draw rectangle we
- 9:01can draw a rectangle with only one color
- 9:03from start to finish and with some
- 9:05transparency it can be useful if we want
- 9:07to color the whole image at once but if
- 9:09we want to draw something on that image
- 9:12or generate an image we need another
- 9:14function for that we're going to use the
- 9:15function write pixels let me explain
- 9:17what it does here you put the start
- 9:19position size position the same thing as
- 9:21with rectangle so let me write the
- 9:23rectangle as well
- 9:26here let's look at the difference
- 9:28between this to in draw rectangle you
- 9:30put the start position the end position
- 9:33and the color with transparency but what
- 9:35do we do with right pixels to write
- 9:37pixels you need a table of pixels you
- 9:40can generate this table so the size of
- 9:42the table should be width multiplied by
- 9:44height multiplied by four let me explain
- 9:46you why the whole table should contain
- 9:47like each pixel and each channel to that
- 9:50pixel and you can write in the table R
- 9:53GB Alpha
- 9:55RGB Alpha and so on so on so on for each
- 9:58pixel so so let's create a simple
- 10:00function that will fill the image with
- 10:01particular
- 10:04color then we're going to create table
- 10:06and we're going to Loop through each
- 10:08pixel and write the value in the
- 10:12table uh yeah as well we're going to put
- 10:14the size of the editable image in that
- 10:26function so basically we can do this in
- 10:29two ways maybe there's more but let's
- 10:31explore the basic two first one is just
- 10:33looping through amount of pixels and
- 10:35we're going to insert the values RGB and
- 10:38Alpha but if you want to be specific and
- 10:40generate for each index that going to be
- 10:43useful for generating you're going to
- 10:44find the index of the pixel by this
- 10:46formula by multiplied by WID plus X and
- 10:49multiplied by four because each pixel
- 10:51has four channels and then we're going
- 10:53to get the index from zero to amount of
- 10:55pixels multiplied by 4us 1 so we're
- 10:58going to increment the value by one this
- 11:00is going to be red Value Green value
- 11:02blue value and Alpha value but remember
- 11:04Alpha is opposite of the transparency we
- 11:06used to assume that transparency zero is
- 11:09visible but alpha 1 is visible Alpha is
- 11:11basically 1 minus transparency so with
- 11:14this we're going to generate a table of
- 11:15pixels let me comment this for now and
- 11:18then we're going to create a table we're
- 11:20going to fill the image with red color
- 11:22and it will be not transparent Alpha
- 11:24equals 1 a yeah and we forgot to return
- 11:26the table for that instance we're going
- 11:28to use only the first Loop then I'm
- 11:30going to press button and the whole
- 11:32editable image will be read so that's
- 11:34how you write pixels but what the hell
- 11:35is the draw utilities so to generate an
- 11:38image it requires like a lot of
- 11:40experience it's not beginner friendly so
- 11:42for this tutorial I prepared a small
- 11:44model called Draw utilities you can open
- 11:46it it's located in the replicated
- 11:48storage it is as well heavily commented
- 11:50so you can read about like everything
- 11:52about Circle for example how do I feel
- 11:55this as you see the similar loop with a
- 11:57lot of explanation so on so on so on
- 11:59that topic is very hard to cover because
- 12:00to generate an image it takes a lot of
- 12:03time so your functions need to be as
- 12:04efficient as possible these functions in
- 12:06draw utilities I spend some time
- 12:08improving their performance and we will
- 12:10talk about this later so the analog to
- 12:12fill image we can remove this one so
- 12:15here we can create the image table as we
- 12:17did before with function create image
- 12:19data we put in the size X we put in the
- 12:21size y you can change it in the function
- 12:23if you want to put just a normal size
- 12:25and then we're going to put the color of
- 12:27red green blue and and at the end we're
- 12:30going to write the pixels so if I press
- 12:32button it's going to become brown but if
- 12:35you put the table of the wrong size or
- 12:38you will not put a table at all it will
- 12:40give you an error like the table size
- 12:42should be X multiplied by y multiplied
- 12:44by four as I described earlier and here
- 12:47let's look at the comparison and there's
- 12:49another function read pixels I would not
- 12:52recommend to use this function very
- 12:54often because it is very slow like I
- 12:55Benchmark the two functions write pixels
- 12:58and read pixel pixels so to write pixels
- 13:00it takes like less than 1 millisecond
- 13:02but to read pixels it takes 12
- 13:03milliseconds because it copies the table
- 13:06to you but if you have the table and you
- 13:07can write the table it will take not too
- 13:09much time yeah and here you can read why
- 13:11the position starts with a zero okay
- 13:13let's go to the next stand let's topic
- 13:16about the generating images let's open
- 13:18the script and look what inside here I'm
- 13:20describing how to use draw utilities
- 13:21first thing you need to do before you do
- 13:24anything with it you need to create an
- 13:26empty image or some image of any kind
- 13:28then you put in the image table inside
- 13:30of that function any function like of
- 13:32draw utilities and that is going to draw
- 13:34on the table I described how slow is the
- 13:36function read pixels so that's why you
- 13:39have to create the table then draw in
- 13:41the table and then put the table inside
- 13:43of the image if you will read the pixels
- 13:45each time you draw something it will be
- 13:48very very slow in this instance I'm
- 13:49drawing just a circle with a radius of
- 13:52150 for that I'm putting the image data
- 13:55the size of the editable image and I'm
- 13:57putting here the position Val where I
- 13:59will draw the circle and as well RGB
- 14:01Alpha value at the end I have as well
- 14:03the function Right image so that's
- 14:06basically the analog to the function
- 14:08right pixels but you don't have to put
- 14:10the vector zero and the editable image
- 14:12size you just put in the editable image
- 14:15and the image you want to write but that
- 14:16image should be the size of the editable
- 14:19image okay let's clear this a yeah and
- 14:21here as well you can see the function
- 14:22that generate the circle you can find
- 14:24that as well in the draw utilities for
- 14:26that you going into the replicate store
- 14:29and look right here so if I press button
- 14:31it's going to generate a circle
- 14:32perfectly in the middle so let's go to
- 14:34the next St it's called functions of
- 14:37draw utilities and we're going to
- 14:38Benchmark them a little bit so let's
- 14:40take a look at the script here I'm
- 14:42drawing the line with thickness like
- 14:43different sizes and I'm benchmarking it
- 14:45The Benchmark code is here so I'm
- 14:47recording the start time recording the
- 14:49end time and I'm just printing the
- 14:51difference multiply by 1,000 to see how
- 14:53much milliseconds it took so here as
- 14:54well you create the empty image to draw
- 14:56something on it draw line with thickness
- 14:58has like a lot of arguments but if you
- 15:00go to the draw utilities you will find
- 15:02the explanation almost to every argument
- 15:04so here you will see the image data
- 15:06editable image size as well then I'm
- 15:08going to say the 0.1 2 then I'm going to
- 15:12put the sickness after this you will
- 15:13encounter a couple more parameters for
- 15:16example there will be density and the
- 15:18quality and as well another parameter
- 15:20rounding so here I benchmarked almost
- 15:23every possible line of course you can
- 15:24Benchmark your own things the codee you
- 15:26can find in this comment so here I'm
- 15:28benchmarking 50 pixel thck line with
- 15:31round edges quality 1 density 1 without
- 15:33rounding without rounding with quality.
- 15:355 density point5 then the line with
- 15:37thickness of 25 with round edges quality
- 15:40one density one and the Very th line
- 15:42with two pixels but on full quality and
- 15:44density so let's press the button and
- 15:46look at the results first one is a line
- 15:48of 50 pixels with round edges quality
- 15:51one and density one it took 17
- 15:53milliseconds to generate so the next one
- 15:55is a thickness 50 but without round
- 15:57edges you see see that round edges took
- 15:59like 7 milliseconds to generate that's
- 16:01because I'm using the square root to
- 16:03generate this round Edge and you see how
- 16:06expensive it is the next one I lowered
- 16:08the quality on half and the density on
- 16:10half as well and it took amazing 1
- 16:13millisecond to generate this but as you
- 16:15see this line is only dots maybe you
- 16:17will find the use of that Maybe not
- 16:19maybe you will always put the quality
- 16:21and density on one the next one is line
- 16:23thickness of 25 pixels it took 5
- 16:26milliseconds to generate with cuality
- 16:28density one round edges so on so on so
- 16:30on and the smallest line two pixels
- 16:32visity on one density one took 1
- 16:34millisecond to generate that is very
- 16:36fast okay let's take a look at another
- 16:38function of the draw utilities maybe you
- 16:40will find it interesting so let me open
- 16:42this and here you see the function draw
- 16:44triangle but it's draw triangle slow
- 16:46because I don't have more optimized
- 16:47function it didn't work and here I'm
- 16:49drawing the normal triangle as well
- 16:51empty image I'm putting the first point
- 16:53second point and the third point I'm
- 16:55putting the red green blue and Alpha
- 16:58only draw line with thickness has two
- 16:59parameters like quality and density all
- 17:01the functions don't so here as well I'm
- 17:03benchmarking this triangle to let you
- 17:05see how long does it take to generate
- 17:07something big let me press the button
- 17:09and let's take a look at the results so
- 17:11we drew a triangle from this point this
- 17:13point and this point and it took 300
- 17:16milliseconds to generate if you write to
- 17:18editable image it will be insanely fast
- 17:20but to generate the image it will be
- 17:21insanely slow okay what we can do with
- 17:24this thing right now we can improve a
- 17:26little bit our drawing game so let's go
- 17:28to theen script so let's remove this
- 17:29line thing we don't need the line for
- 17:31now here I'm going to require the draw
- 17:33utilities and now let's change this a
- 17:36little bit remove this one and uncomment
- 17:39this one then we're going to uncomment
- 17:40as well our un service loop and here I'm
- 17:43going to save the mouse
- 17:47position so first I'm going to generate
- 17:49the empty
- 17:52image and then if we have first Mouse
- 17:55position so start where we press the
- 17:57button we going to to write the line
- 17:59from this previous position to the new
- 18:08one okay and now let's take a look at
- 18:11this so I'm going to generate the line
- 18:12with sickness of 15 and I'm going to
- 18:14draw yeah as you see it became a little
- 18:17bit better to draw but it can be more
- 18:19optimized so if we doing some very rapid
- 18:22movements right the Roblox is going to
- 18:24pick up this thing yeah and we can draw
- 18:26the whole image now let's go to the
- 18:28stand and let's take a look how did I
- 18:30make the animation for our character so
- 18:32our character has a Sprite sheet of
- 18:34animations for this I'm going to split
- 18:36this Sprite sheet on the smaller Sprites
- 18:39with particular size the next we will
- 18:41encounter the problem as you see the
- 18:43decal we use in the de right now and it
- 18:45doesn't like the very small images so
- 18:47we're going to upscale this image so
- 18:49both these functions you can find in the
- 18:51draw utilities as well so let's open the
- 18:53script and take a look how does it work
- 18:55first I'm creating the editable image
- 18:57empty image as well I'm using the Sprite
- 18:59sheet URL I'm creating the editable
- 19:01image from the Sprite sheet then I'm
- 19:03going to define the Sprite size as will
- 19:06be 24x 24 pixels the Sprite I'm going to
- 19:09get by the function split it going to
- 19:11return us all the images of this
- 19:13particular size so 24x 24 but if you
- 19:15have the image like this one pixel
- 19:18bigger or something like that it's going
- 19:20to give you this one pixel image and if
- 19:22you write that one pixel image inside of
- 19:25the editable image yeah it can give you
- 19:27an because size is not proper so what do
- 19:30I do next I'm destroying the Sprite
- 19:32sheet because I don't need it I already
- 19:33got data then I'm scaling this Sprite
- 19:36size by 10 times and I'm looping through
- 19:38each Sprite and I'm scaling it if I'm
- 19:40scaling the image it doesn't overwrite
- 19:42the original image it gives you the new
- 19:44scaled image so I'm going to rewrite the
- 19:46existing image with new scaled image I'm
- 19:49going to use mode linear I don't have
- 19:51bil linear for now I'm changing the
- 19:52editable image size to the scaled Sprite
- 19:55size then I have a greed we have a lot
- 19:56of animations it is by seven let me open
- 19:59the script once again then I'm going to
- 20:01create a function that takes the index
- 20:03of that image because we have only one
- 20:05Dray we want to get the image in 2D
- 20:08array so here I'm multiplying y by VDS
- 20:11and I'm adding the X and at the end I'm
- 20:13going to add the one because Roblox
- 20:15table starts with one then I have some
- 20:17table for the animation called run it is
- 20:19Row one so we starting with 0 0 in that
- 20:22case so run animation V bow one and it
- 20:25is six frames let's open the script then
- 20:27I have my FPS counter I'm waiting 1
- 20:30divided by FPS time then you're going to
- 20:32need the iterator variable that's going
- 20:34to Loop through each animation frame and
- 20:36set new one then I'm going to mod this
- 20:39to the amount of frames that it's going
- 20:41to be from 0 1 2 3 4 5 5 The amount of
- 20:44frames is six it's going to return to
- 20:46zero so it's going to be the first frame
- 20:47then I'm going to just write the Sprite
- 20:50inside of the editable image I basically
- 20:51don't need this but let it be now let me
- 20:54press run as you see it processed our
- 20:55image and it displayed this right 7
- 20:58times per second yeah so that's how our
- 21:00animations look as you see my character
- 21:02got a little bit more animations you can
- 21:05look at the script of the character
- 21:07inside of the starter layer then you go
- 21:09to the character script and animator
- 21:11here you will maybe find something
- 21:12useful so let's go to another stand that
- 21:15is another great example how to generate
- 21:17an image for example let us open the
- 21:19script inside of it I'm generating the
- 21:21RGB image like you see when you picking
- 21:23the color let me show you an example if
- 21:25I press this color wheel you will see
- 21:27this rainbow image where you can pick
- 21:30the color of course you can make this
- 21:32image by yourself you don't need to go
- 21:34to Google and search for it because you
- 21:35can generated here I'm using the most
- 21:37useful function I've ever created then
- 21:39I'm looping through each pixel here the
- 21:41loop you saw earlier then I'm using the
- 21:43X and Y values to get the color of the
- 21:46image in that particular pixel so for
- 21:48example here you see from here to here
- 21:50I'm going to use the color space HSV
- 21:53that is hug saturation value you can
- 21:54read about this in the internet or here
- 21:56somewhere in the comments you can find
- 21:58the link then I'm going to use the
- 22:00faster function of converting HSV to RGB
- 22:03so I'm converting the X from Z to size x
- 22:05- one to range from 0 to 1 and the same
- 22:08thing for y but I'm converting to the
- 22:10range from 1 to zero that will be
- 22:12inversed so zero here will be one here
- 22:15you can read about this function here in
- 22:16the description then I'm converting HSV
- 22:19to RGB and I'm writing as well RGB and
- 22:22fully visible that is heavily coed of
- 22:24course you can just take a look at this
- 22:26so let me press a button if I press the
- 22:28button it takes some time but at the end
- 22:30I'm getting this small beautiful image
- 22:32yeah of course you can find it in the
- 22:34internet and you can do like a lot of
- 22:36analogs of the editable image but Isn't
- 22:38that cool you're generating your own
- 22:39image that thing taking the images from
- 22:42other person generate it if you have a
- 22:44good algorithm you can generate a cat
- 22:45okay let's take a look at the other
- 22:47stand the other stand is very special
- 22:50because it's a bonus recently I was
- 22:52curious about can I put like an image
- 22:54inside of Roblox without ever pling it
- 22:56for example to compress this image to
- 22:58convert it into string put it in Roblox
- 23:00not the image itself I'm putting the
- 23:02string just the normal text and then I
- 23:04reverse this text back to the image so I
- 23:06started my project on C++ right now let
- 23:09me show you of course the source code to
- 23:11that project you can find in the
- 23:13description on GitHub and of course you
- 23:15can find the link to that XE file so let
- 23:18me show you how it works the first you
- 23:20will have just XE file DL this thing I
- 23:22don't know whether I need to put this
- 23:24and the core after you run in this x
- 23:27file it will create create images and
- 23:28out two folders then you put every image
- 23:31you want to convert to string like two
- 23:33images in this case this will be YouTube
- 23:35icon subscribe or the format Webb it
- 23:38does support it if I run this I press in
- 23:40enter and it compiled my image 80 kiloby
- 23:44a great size if I open this image you
- 23:47will see you can read this image and you
- 23:49can like select the whole image and copy
- 23:51let me open the normal image for example
- 23:52I'm going to open this with notepad you
- 23:54will see a bunch of different symbols
- 23:57very scary ones that you always look at
- 23:59it and what the hell is this but the
- 24:01thing is you cannot copy like half of
- 24:03them not the half but a little bit less
- 24:06there's a symbol that you cannot copy
- 24:07and that's the problem because you will
- 24:09lose the data from that image and you
- 24:10will not be able to restore that's why
- 24:12you will see the image like this written
- 24:14in a fully readable text of course it
- 24:16takes a little bit more data and a
- 24:18little bit more computation to convert
- 24:20this to the readable text so I'm going
- 24:22to take the text I'm going to the stand
- 24:24and I put this image inside of this
- 24:27module script image as you see I put
- 24:29this 80 kiloby string inside of one
- 24:31single model script let me close it
- 24:33let's open the script of the Sprite and
- 24:35let's take a look how we can restore the
- 24:37image from the string of course you can
- 24:39find more description on the GitHub Link
- 24:41in the description so now when you
- 24:43require the model or the image it's
- 24:44going to return as a text it's going to
- 24:46be image 64 and then we need to decod it
- 24:49for this you can use a couple models
- 24:51that you will find here of course you
- 24:52can copy them bring them to your own
- 24:54place from this Z lip is open library
- 24:57and everything everything else is
- 24:58written by me so here first to recover
- 25:00the image I'm going to create editable
- 25:02image first then I'm going to put this
- 25:04image back to the normal string like it
- 25:07was from this B 64 then I'm going to put
- 25:09this string inside of the buffer so
- 25:11convert buffer to string after this I'm
- 25:13going to decompress this buffer it took
- 25:15a lot of steps because I had to put like
- 25:17the data from C++ to L and from L back
- 25:20to C++ yeah it was a little bit
- 25:22stressful then you're going to
- 25:23decompress the buffer this buffer
- 25:25utility is decompressed it's going to
- 25:27return the buff buff then you have to
- 25:28convert the buffer back to the string so
- 25:30read string from zero to length of
- 25:32buffer then you're going to again
- 25:34convert this from the base 64 and then
- 25:36you're going to create the buffer again
- 25:37with the string you decoded and there's
- 25:40one last step almost one last step you
- 25:42need to decode the image I used encoding
- 25:44of K it is recent algorithm of encoding
- 25:47images it is basically very fast to
- 25:49decode encode but you will achieve the
- 25:52size of the PNG and after I'm encoding
- 25:55Ki I'm compressing it with Z is very
- 25:58interesting one you like cutting the 70%
- 26:01of that image size but if I convert to
- 26:03this base it's going to again restore
- 26:06some size but it's not as big as
- 26:07original imager then I'm going to decode
- 26:09this buffer I need to put buffer here
- 26:11I'm going to get the data so that's
- 26:13again buffer I'm going to get the vids
- 26:15height channels and color space channels
- 26:17can be three or four that depends on
- 26:19original image but Q will always return
- 26:22four channels because it will be a
- 26:24little bit easier for you to write in
- 26:26the editable image so you don't need to
- 26:28like convert it back to the color 4 or
- 26:30something like that but it just gives
- 26:31you some information at how much
- 26:33channels does that image have okay then
- 26:35I'm going to create the image table so
- 26:38this is the buffer and we cannot write
- 26:39buffer inside of the editable image so
- 26:41I'm going to use this function I'm going
- 26:43to convert buffer to table and then I'm
- 26:45going to put parameter here to true
- 26:47because I'm storing the pixels from 0 to
- 26:49255 so as well encounter on that one if
- 26:52you want to like encode this image
- 26:53convert this in range from 0 to 255 and
- 26:56let it be in Tanger and floor this
- 26:58values so I'm going to put this through
- 26:59that's going to convert it back to from
- 27:010 to one it's going to convert to the
- 27:03normal range that editable image can
- 27:05read then I'm going just to write this
- 27:07image to the editable image so I'm going
- 27:10to press run and I'm going to test this
- 27:11stand okay let's press this button and
- 27:14let's see what happens subscribe of
- 27:16course you can do this the image
- 27:17encourages you that is basically I think
- 27:19the foundation of the new project I'm
- 27:20working on about video compression you
- 27:22will be able to compress the whole video
- 27:24put it in Roblox maybe you can do
- 27:26something small with normal image labels
- 27:29but it's only a string and you putting
- 27:31string to Roblox and you playing this as
- 27:33a video isn't that impressive I'm right
- 27:35now learning a couple other compression
- 27:37algorithms but that will be a little bit
- 27:39later when I release the new version
- 27:41that will be able to compress videos and
- 27:44maybe all stuff then you will be able to
- 27:46put this in Roblox yeah the Roblox
- 27:48prices are incredible 2,000 robox per
- 27:50video and three uploads per month oh my
- 27:52good I'm going to pay so let me explain
- 27:54how to use this XF file one XF file is
- 27:57not enough you need to install one C++
- 27:59Library called open CV so the link to
- 28:01that Library will be as well in the
- 28:03description it is going to look like
- 28:05this then you go get started then you're
- 28:07going to press on C++ this link make
- 28:11sure that you're installing
- 28:13490 maybe you watch this in the far
- 28:16future where we have flying cars where
- 28:19we superheroes flying on our costumes to
- 28:22work so
- 28:24so just make sure that you're installing
- 28:264.9 .0 you're going to need this EXA
- 28:30file then you need to install this
- 28:32Library I installed this library on the
- 28:34disk D here it is you open this Library
- 28:37you go to build x64 vc16 and then you're
- 28:41going to open the bean folder then you
- 28:44copy the pass to the beIN folder that is
- 28:47very important then you right click on
- 28:49the Windows button you go to system
- 28:52Advanced system settings need to open
- 28:55this thing Advanced system settings you
- 28:57open environmental variables you double
- 29:00click on pass after this you press in
- 29:02new and you put in the link of the beIN
- 29:05file you copy it here that is the same
- 29:07like pass as you see open CV build x64
- 29:11VC and Bin so you put it here you press
- 29:14okay okay and then you can use this
- 29:16program after this you just put
- 29:18everything you want to compress inside
- 29:20of the images and you press enter in
- 29:22this EXA program if you got like a lot
- 29:25of images you need to wait a little
- 29:27little bit until it starts to Sav in the
- 29:29images if it's done with image it's
- 29:31going to save that in the file that is
- 29:33going to be here you will find it here
- 29:35in the text file is going to have the
- 29:37same name so and for today that's it
- 29:39thank you for watching and hope you're
- 29:41doing great
- 29:43bye-bye
About this transcript
This page contains the full transcript of Туториал по редактируемым изображениям в Roblox Studio + БОНУС by Catargo, generated from the public captions YouTube serves with the video. The transcript has 5,995 words across 796 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.