YouTube2Text

Туториал по редактируемым изображениям в Roblox Studio + БОНУС — Transcript

by Catargo · 5,995 words · 796 segments · language en · Watch on YouTube

Full transcript

  1. 0:00you're looking at the animation you want
  2. 0:02to become like that you B of being 3D
  3. 0:06you want to become
  4. 0:092D but Isn't that cool you're generating
  5. 0:12your only
  6. 0:13W that you can run and it looks very
  7. 0:16cool and it took amazing 1 millisecond
  8. 0:19to
  9. 0:20generate it became a little bit better
  10. 0:23to draw but it can be more optimized at
  11. 0:25the end I'm getting this small beautiful
  12. 0:28image hi if you want to generate an
  13. 0:30image create a mini map for example V
  14. 0:32effects or to play a video Welcome to
  15. 0:34the tutorial today we're going to
  16. 0:36explore the editable image first before
  17. 0:38that let's talk about the properties of
  18. 0:40the editable image the maximum size is
  19. 0:421,24 by 1,24 if it's bigger it's going
  20. 0:46to snap to that in order to write the
  21. 0:47pixels in the editable image remember
  22. 0:50that all pixels are located in only one
  23. 0:53table and for each pixels there are four
  24. 0:55values and it goes like RGB Alpha RGB
  25. 0:59Alpha and so on so so on so on next one
  26. 1:01you can apply editable image almost to
  27. 1:04everything that has an image except of
  28. 1:06surface appearance and then once I said
  29. 1:08like the editable image is very very
  30. 1:10fast it is but it's not let me explain
  31. 1:13you why if you only write in the image
  32. 1:15it will be insanely fast like you can
  33. 1:17achieve 100 FPS 120 but if you generate
  34. 1:21the image it will be hell lot of slow to
  35. 1:23generate only one image on the big
  36. 1:26screen right maximum size 1,24 by 1,24
  37. 1:29it can take like up to a couple seconds
  38. 1:32but how we can fight with it how we can
  39. 1:34increase the speed of that for that I'm
  40. 1:36going to give you just a couple tips
  41. 1:39avoid something like Mass do Square
  42. 1:41rooting your functions avoid calling
  43. 1:43function for each pixel it will slow
  44. 1:45down the process okay let's start with
  45. 1:47the tutorial I'm going to turn off this
  46. 1:49annoying lamp you not going to see me
  47. 1:52very good but it's going to bur my eyes
  48. 1:54so today I'm going to switch the style a
  49. 1:56little bit how I make tutorials instead
  50. 1:58of just endlessly wri in the functions I
  51. 2:01prepared the whole place where you can
  52. 2:02go and look at the scripts and look what
  53. 2:04it do so the link to that place will be
  54. 2:06in the description and don't forget to
  55. 2:08enable the better feature editable
  56. 2:10images editable meses and at the end of
  57. 2:13this video there will be a small bonus
  58. 2:14for those people who want to compress
  59. 2:16videos and images here I prepared a lot
  60. 2:20of stance with different functions and a
  61. 2:23lot of the explanations if you for
  62. 2:25example open a script you can go to the
  63. 2:27stand decal and a script you see how
  64. 2:29heavily commented this so again link on
  65. 2:32the place in the description and let's
  66. 2:33start with the video before we go into
  67. 2:35any St let me show you the possibility
  68. 2:37of the editable image of course you can
  69. 2:39do this like without editable image but
  70. 2:41for tutorial we're going to do
  71. 2:42everything with it for this video I
  72. 2:44created like a small character that you
  73. 2:46can run as him as you see it is animated
  74. 2:50and it looks very cool first thing how
  75. 2:52to create an editable image so let's
  76. 2:54take a look at first two STS so I'm
  77. 2:56going to open the script every script
  78. 2:58you can find in the decal and the script
  79. 3:00first one is going to create an empty
  80. 3:02image so you just use instance. New
  81. 3:05editable Image and like in the case of
  82. 3:07the editable mesh if you paren this to
  83. 3:09the image object it will override the
  84. 3:11image so if you want to save every pixel
  85. 3:14of this amongus you have to use the
  86. 3:16asset service but instead of putting
  87. 3:17image object inside of this create
  88. 3:19editable image sync you put the texture
  89. 3:22of the image or just the link and then
  90. 3:23you parent this editable image to the
  91. 3:25image object let's take a look here's
  92. 3:27without asset service a press and amus
  93. 3:30has disappeared because editable image
  94. 3:32overwrites the existing image and with
  95. 3:34this I'm using the asset service if I
  96. 3:36press nothing happens because we saved
  97. 3:38the image and in the course of this
  98. 3:40tutorial we're going to create a drawing
  99. 3:42game a small drawing game for this we
  100. 3:44need to explore some basic functions
  101. 3:46let's open this stand the editable image
  102. 3:48has something like draw rectangle draw
  103. 3:50Circle draw a line we put the position
  104. 3:53in case of rectangle we put the start
  105. 3:55position and the color with transparency
  106. 3:57as well now the next one is draw Circle
  107. 3:59you just put the position of the circle
  108. 4:01radius of the circle as well color and
  109. 4:03transparency and the last one is draw
  110. 4:05line it has position one and position
  111. 4:08color and transparency as well so I'm
  112. 4:10going to press this button so it draw a
  113. 4:12circle yellow circle line as you see one
  114. 4:15pixel line and a rectangle so let's
  115. 4:17start with our drawing game for this we
  116. 4:18need a gii I already created a screen
  117. 4:20gii here we're going to create an image
  118. 4:23label for this because we need an object
  119. 4:25that has an image and we're going to use
  120. 4:26the maximum size of the editable image
  121. 4:28which is24 so I'm going to put the size
  122. 4:30of the image label here as you see it's
  123. 4:32totally gigantic but let me put on a
  124. 4:34test it is going to be 90/20 so let us
  125. 4:38Center that image as well some
  126. 4:39adjustments so first let's create a
  127. 4:41script in it we're going to create an
  128. 4:43editable image with instance and parent
  129. 4:46it to the image
  130. 4:48object and we're going to put the size
  131. 4:50of the editable image to
  132. 4:521024 okay that's going to overwrite our
  133. 4:55image next we need a mouse and the local
  134. 4:58player to draw the mouse is enough right
  135. 5:01but we're going to Define run Service as
  136. 5:03well okay next we're going to create the
  137. 5:06function that going to detect the mouse
  138. 5:08position on the canvas this we're going
  139. 5:09to use the absolute position of the
  140. 5:23object okay with that we first find the
  141. 5:27relative position to the canvas after
  142. 5:29this we multiply the scale by the
  143. 5:31editable image size that's because the
  144. 5:33editable image size can be very
  145. 5:35different and as well we're going to
  146. 5:37floor this Vector so let's rewrite a
  147. 5:39little
  148. 5:42bit then we need to detect if we
  149. 5:44pressing the
  150. 5:46button and as well let's do something
  151. 5:49with it so in our case we're going to
  152. 5:51draw a circle where we
  153. 5:58press and this transparency zero and now
  154. 6:00we need to connect this to the mouse
  155. 6:02click okay and the thing is we
  156. 6:04multiplied Mouse relative position but
  157. 6:07we need multiply Mouse relative scale in
  158. 6:09order to get the position okay and now
  159. 6:11we press run this and if you click you
  160. 6:14spawn the black sphere on the mouse
  161. 6:16position yeah but we want to draw with
  162. 6:18that so let's use run series for this we
  163. 6:21need to detect if we clicked or no and
  164. 6:23then if we clicked we're going to draw a
  165. 6:24circle so let's create a variable and
  166. 6:27let's record if we click the button or
  167. 6:29no
  168. 6:32okay uh then we don't need it here we're
  169. 6:35going to cut it with crl X then we're
  170. 6:37going to connect it to render step tent
  171. 6:40it is run service and let's connect T
  172. 6:42the function when we release the button
  173. 6:45in run service we're going to pass our
  174. 6:47script with mouse position we're going
  175. 6:49to get the mouse position and we're
  176. 6:51going to draw a circle and then we need
  177. 6:53to check if we pressing the button okay
  178. 6:56and let's test game as you see we drawn
  179. 6:58a circle if if we holding the left Mouse
  180. 7:01button but for some cases it's not
  181. 7:03enough when we move the mouse too fast
  182. 7:05we can of course use the FPS
  183. 7:08unlocker okay this FPS unlocker a little
  184. 7:11bit better but still not enough and for
  185. 7:13all case let's just draw a line if we
  186. 7:16hold the right Mouse button that we're
  187. 7:18going to detect the same thing and I'm
  188. 7:20going to change a couple
  189. 7:27things so if we press press the right
  190. 7:30Mouse button we're going to save the
  191. 7:32position of the mouse and then update it
  192. 7:34each frame like where it
  193. 7:39goes then if we release the button we're
  194. 7:41going to draw line from one position to
  195. 7:44another
  196. 7:49position and again if our Mouse is too
  197. 7:51far away we're going to snap that
  198. 7:53position back to our
  199. 7:57canvas and as well we're going to clear
  200. 8:00the variable Mouse
  201. 8:02position and yeah of course we need to
  202. 8:05disable our character because we cannot
  203. 8:06move the mouse and for now instead of
  204. 8:08disabling the character let's just
  205. 8:10instead of circles we're going to draw
  206. 8:12the lines so I'm going to use the button
  207. 8:14one button one and again let's just take
  208. 8:16the two if I hold my left Mouse button
  209. 8:20we can draw line from one place to
  210. 8:22another oh yeah and let's fix a couple
  211. 8:23things like this one and this one by the
  212. 8:25way here index starts with 0 0 not with
  213. 8:28one one it's not a regular lower table
  214. 8:31and to find out that you can look in the
  215. 8:33scripts in The Stance I somewhere put
  216. 8:35that in the comments so you can go and
  217. 8:37download the place okay we got our small
  218. 8:39drawing game but lines and circles it's
  219. 8:42not enough let's take a look how we can
  220. 8:43draw pixels for this we going to our
  221. 8:45next tent that will explain us how to
  222. 8:48write pixels if I open the scripts
  223. 8:50you're going to see something strange
  224. 8:51like throw utilities but for now let's
  225. 8:54just focus on how to write pixels so to
  226. 8:56write pixels to the image we can use
  227. 8:58editable image like draw rectangle we
  228. 9:01can draw a rectangle with only one color
  229. 9:03from start to finish and with some
  230. 9:05transparency it can be useful if we want
  231. 9:07to color the whole image at once but if
  232. 9:09we want to draw something on that image
  233. 9:12or generate an image we need another
  234. 9:14function for that we're going to use the
  235. 9:15function write pixels let me explain
  236. 9:17what it does here you put the start
  237. 9:19position size position the same thing as
  238. 9:21with rectangle so let me write the
  239. 9:23rectangle as well
  240. 9:26here let's look at the difference
  241. 9:28between this to in draw rectangle you
  242. 9:30put the start position the end position
  243. 9:33and the color with transparency but what
  244. 9:35do we do with right pixels to write
  245. 9:37pixels you need a table of pixels you
  246. 9:40can generate this table so the size of
  247. 9:42the table should be width multiplied by
  248. 9:44height multiplied by four let me explain
  249. 9:46you why the whole table should contain
  250. 9:47like each pixel and each channel to that
  251. 9:50pixel and you can write in the table R
  252. 9:53GB Alpha
  253. 9:55RGB Alpha and so on so on so on for each
  254. 9:58pixel so so let's create a simple
  255. 10:00function that will fill the image with
  256. 10:01particular
  257. 10:04color then we're going to create table
  258. 10:06and we're going to Loop through each
  259. 10:08pixel and write the value in the
  260. 10:12table uh yeah as well we're going to put
  261. 10:14the size of the editable image in that
  262. 10:26function so basically we can do this in
  263. 10:29two ways maybe there's more but let's
  264. 10:31explore the basic two first one is just
  265. 10:33looping through amount of pixels and
  266. 10:35we're going to insert the values RGB and
  267. 10:38Alpha but if you want to be specific and
  268. 10:40generate for each index that going to be
  269. 10:43useful for generating you're going to
  270. 10:44find the index of the pixel by this
  271. 10:46formula by multiplied by WID plus X and
  272. 10:49multiplied by four because each pixel
  273. 10:51has four channels and then we're going
  274. 10:53to get the index from zero to amount of
  275. 10:55pixels multiplied by 4us 1 so we're
  276. 10:58going to increment the value by one this
  277. 11:00is going to be red Value Green value
  278. 11:02blue value and Alpha value but remember
  279. 11:04Alpha is opposite of the transparency we
  280. 11:06used to assume that transparency zero is
  281. 11:09visible but alpha 1 is visible Alpha is
  282. 11:11basically 1 minus transparency so with
  283. 11:14this we're going to generate a table of
  284. 11:15pixels let me comment this for now and
  285. 11:18then we're going to create a table we're
  286. 11:20going to fill the image with red color
  287. 11:22and it will be not transparent Alpha
  288. 11:24equals 1 a yeah and we forgot to return
  289. 11:26the table for that instance we're going
  290. 11:28to use only the first Loop then I'm
  291. 11:30going to press button and the whole
  292. 11:32editable image will be read so that's
  293. 11:34how you write pixels but what the hell
  294. 11:35is the draw utilities so to generate an
  295. 11:38image it requires like a lot of
  296. 11:40experience it's not beginner friendly so
  297. 11:42for this tutorial I prepared a small
  298. 11:44model called Draw utilities you can open
  299. 11:46it it's located in the replicated
  300. 11:48storage it is as well heavily commented
  301. 11:50so you can read about like everything
  302. 11:52about Circle for example how do I feel
  303. 11:55this as you see the similar loop with a
  304. 11:57lot of explanation so on so on so on
  305. 11:59that topic is very hard to cover because
  306. 12:00to generate an image it takes a lot of
  307. 12:03time so your functions need to be as
  308. 12:04efficient as possible these functions in
  309. 12:06draw utilities I spend some time
  310. 12:08improving their performance and we will
  311. 12:10talk about this later so the analog to
  312. 12:12fill image we can remove this one so
  313. 12:15here we can create the image table as we
  314. 12:17did before with function create image
  315. 12:19data we put in the size X we put in the
  316. 12:21size y you can change it in the function
  317. 12:23if you want to put just a normal size
  318. 12:25and then we're going to put the color of
  319. 12:27red green blue and and at the end we're
  320. 12:30going to write the pixels so if I press
  321. 12:32button it's going to become brown but if
  322. 12:35you put the table of the wrong size or
  323. 12:38you will not put a table at all it will
  324. 12:40give you an error like the table size
  325. 12:42should be X multiplied by y multiplied
  326. 12:44by four as I described earlier and here
  327. 12:47let's look at the comparison and there's
  328. 12:49another function read pixels I would not
  329. 12:52recommend to use this function very
  330. 12:54often because it is very slow like I
  331. 12:55Benchmark the two functions write pixels
  332. 12:58and read pixel pixels so to write pixels
  333. 13:00it takes like less than 1 millisecond
  334. 13:02but to read pixels it takes 12
  335. 13:03milliseconds because it copies the table
  336. 13:06to you but if you have the table and you
  337. 13:07can write the table it will take not too
  338. 13:09much time yeah and here you can read why
  339. 13:11the position starts with a zero okay
  340. 13:13let's go to the next stand let's topic
  341. 13:16about the generating images let's open
  342. 13:18the script and look what inside here I'm
  343. 13:20describing how to use draw utilities
  344. 13:21first thing you need to do before you do
  345. 13:24anything with it you need to create an
  346. 13:26empty image or some image of any kind
  347. 13:28then you put in the image table inside
  348. 13:30of that function any function like of
  349. 13:32draw utilities and that is going to draw
  350. 13:34on the table I described how slow is the
  351. 13:36function read pixels so that's why you
  352. 13:39have to create the table then draw in
  353. 13:41the table and then put the table inside
  354. 13:43of the image if you will read the pixels
  355. 13:45each time you draw something it will be
  356. 13:48very very slow in this instance I'm
  357. 13:49drawing just a circle with a radius of
  358. 13:52150 for that I'm putting the image data
  359. 13:55the size of the editable image and I'm
  360. 13:57putting here the position Val where I
  361. 13:59will draw the circle and as well RGB
  362. 14:01Alpha value at the end I have as well
  363. 14:03the function Right image so that's
  364. 14:06basically the analog to the function
  365. 14:08right pixels but you don't have to put
  366. 14:10the vector zero and the editable image
  367. 14:12size you just put in the editable image
  368. 14:15and the image you want to write but that
  369. 14:16image should be the size of the editable
  370. 14:19image okay let's clear this a yeah and
  371. 14:21here as well you can see the function
  372. 14:22that generate the circle you can find
  373. 14:24that as well in the draw utilities for
  374. 14:26that you going into the replicate store
  375. 14:29and look right here so if I press button
  376. 14:31it's going to generate a circle
  377. 14:32perfectly in the middle so let's go to
  378. 14:34the next St it's called functions of
  379. 14:37draw utilities and we're going to
  380. 14:38Benchmark them a little bit so let's
  381. 14:40take a look at the script here I'm
  382. 14:42drawing the line with thickness like
  383. 14:43different sizes and I'm benchmarking it
  384. 14:45The Benchmark code is here so I'm
  385. 14:47recording the start time recording the
  386. 14:49end time and I'm just printing the
  387. 14:51difference multiply by 1,000 to see how
  388. 14:53much milliseconds it took so here as
  389. 14:54well you create the empty image to draw
  390. 14:56something on it draw line with thickness
  391. 14:58has like a lot of arguments but if you
  392. 15:00go to the draw utilities you will find
  393. 15:02the explanation almost to every argument
  394. 15:04so here you will see the image data
  395. 15:06editable image size as well then I'm
  396. 15:08going to say the 0.1 2 then I'm going to
  397. 15:12put the sickness after this you will
  398. 15:13encounter a couple more parameters for
  399. 15:16example there will be density and the
  400. 15:18quality and as well another parameter
  401. 15:20rounding so here I benchmarked almost
  402. 15:23every possible line of course you can
  403. 15:24Benchmark your own things the codee you
  404. 15:26can find in this comment so here I'm
  405. 15:28benchmarking 50 pixel thck line with
  406. 15:31round edges quality 1 density 1 without
  407. 15:33rounding without rounding with quality.
  408. 15:355 density point5 then the line with
  409. 15:37thickness of 25 with round edges quality
  410. 15:40one density one and the Very th line
  411. 15:42with two pixels but on full quality and
  412. 15:44density so let's press the button and
  413. 15:46look at the results first one is a line
  414. 15:48of 50 pixels with round edges quality
  415. 15:51one and density one it took 17
  416. 15:53milliseconds to generate so the next one
  417. 15:55is a thickness 50 but without round
  418. 15:57edges you see see that round edges took
  419. 15:59like 7 milliseconds to generate that's
  420. 16:01because I'm using the square root to
  421. 16:03generate this round Edge and you see how
  422. 16:06expensive it is the next one I lowered
  423. 16:08the quality on half and the density on
  424. 16:10half as well and it took amazing 1
  425. 16:13millisecond to generate this but as you
  426. 16:15see this line is only dots maybe you
  427. 16:17will find the use of that Maybe not
  428. 16:19maybe you will always put the quality
  429. 16:21and density on one the next one is line
  430. 16:23thickness of 25 pixels it took 5
  431. 16:26milliseconds to generate with cuality
  432. 16:28density one round edges so on so on so
  433. 16:30on and the smallest line two pixels
  434. 16:32visity on one density one took 1
  435. 16:34millisecond to generate that is very
  436. 16:36fast okay let's take a look at another
  437. 16:38function of the draw utilities maybe you
  438. 16:40will find it interesting so let me open
  439. 16:42this and here you see the function draw
  440. 16:44triangle but it's draw triangle slow
  441. 16:46because I don't have more optimized
  442. 16:47function it didn't work and here I'm
  443. 16:49drawing the normal triangle as well
  444. 16:51empty image I'm putting the first point
  445. 16:53second point and the third point I'm
  446. 16:55putting the red green blue and Alpha
  447. 16:58only draw line with thickness has two
  448. 16:59parameters like quality and density all
  449. 17:01the functions don't so here as well I'm
  450. 17:03benchmarking this triangle to let you
  451. 17:05see how long does it take to generate
  452. 17:07something big let me press the button
  453. 17:09and let's take a look at the results so
  454. 17:11we drew a triangle from this point this
  455. 17:13point and this point and it took 300
  456. 17:16milliseconds to generate if you write to
  457. 17:18editable image it will be insanely fast
  458. 17:20but to generate the image it will be
  459. 17:21insanely slow okay what we can do with
  460. 17:24this thing right now we can improve a
  461. 17:26little bit our drawing game so let's go
  462. 17:28to theen script so let's remove this
  463. 17:29line thing we don't need the line for
  464. 17:31now here I'm going to require the draw
  465. 17:33utilities and now let's change this a
  466. 17:36little bit remove this one and uncomment
  467. 17:39this one then we're going to uncomment
  468. 17:40as well our un service loop and here I'm
  469. 17:43going to save the mouse
  470. 17:47position so first I'm going to generate
  471. 17:49the empty
  472. 17:52image and then if we have first Mouse
  473. 17:55position so start where we press the
  474. 17:57button we going to to write the line
  475. 17:59from this previous position to the new
  476. 18:08one okay and now let's take a look at
  477. 18:11this so I'm going to generate the line
  478. 18:12with sickness of 15 and I'm going to
  479. 18:14draw yeah as you see it became a little
  480. 18:17bit better to draw but it can be more
  481. 18:19optimized so if we doing some very rapid
  482. 18:22movements right the Roblox is going to
  483. 18:24pick up this thing yeah and we can draw
  484. 18:26the whole image now let's go to the
  485. 18:28stand and let's take a look how did I
  486. 18:30make the animation for our character so
  487. 18:32our character has a Sprite sheet of
  488. 18:34animations for this I'm going to split
  489. 18:36this Sprite sheet on the smaller Sprites
  490. 18:39with particular size the next we will
  491. 18:41encounter the problem as you see the
  492. 18:43decal we use in the de right now and it
  493. 18:45doesn't like the very small images so
  494. 18:47we're going to upscale this image so
  495. 18:49both these functions you can find in the
  496. 18:51draw utilities as well so let's open the
  497. 18:53script and take a look how does it work
  498. 18:55first I'm creating the editable image
  499. 18:57empty image as well I'm using the Sprite
  500. 18:59sheet URL I'm creating the editable
  501. 19:01image from the Sprite sheet then I'm
  502. 19:03going to define the Sprite size as will
  503. 19:06be 24x 24 pixels the Sprite I'm going to
  504. 19:09get by the function split it going to
  505. 19:11return us all the images of this
  506. 19:13particular size so 24x 24 but if you
  507. 19:15have the image like this one pixel
  508. 19:18bigger or something like that it's going
  509. 19:20to give you this one pixel image and if
  510. 19:22you write that one pixel image inside of
  511. 19:25the editable image yeah it can give you
  512. 19:27an because size is not proper so what do
  513. 19:30I do next I'm destroying the Sprite
  514. 19:32sheet because I don't need it I already
  515. 19:33got data then I'm scaling this Sprite
  516. 19:36size by 10 times and I'm looping through
  517. 19:38each Sprite and I'm scaling it if I'm
  518. 19:40scaling the image it doesn't overwrite
  519. 19:42the original image it gives you the new
  520. 19:44scaled image so I'm going to rewrite the
  521. 19:46existing image with new scaled image I'm
  522. 19:49going to use mode linear I don't have
  523. 19:51bil linear for now I'm changing the
  524. 19:52editable image size to the scaled Sprite
  525. 19:55size then I have a greed we have a lot
  526. 19:56of animations it is by seven let me open
  527. 19:59the script once again then I'm going to
  528. 20:01create a function that takes the index
  529. 20:03of that image because we have only one
  530. 20:05Dray we want to get the image in 2D
  531. 20:08array so here I'm multiplying y by VDS
  532. 20:11and I'm adding the X and at the end I'm
  533. 20:13going to add the one because Roblox
  534. 20:15table starts with one then I have some
  535. 20:17table for the animation called run it is
  536. 20:19Row one so we starting with 0 0 in that
  537. 20:22case so run animation V bow one and it
  538. 20:25is six frames let's open the script then
  539. 20:27I have my FPS counter I'm waiting 1
  540. 20:30divided by FPS time then you're going to
  541. 20:32need the iterator variable that's going
  542. 20:34to Loop through each animation frame and
  543. 20:36set new one then I'm going to mod this
  544. 20:39to the amount of frames that it's going
  545. 20:41to be from 0 1 2 3 4 5 5 The amount of
  546. 20:44frames is six it's going to return to
  547. 20:46zero so it's going to be the first frame
  548. 20:47then I'm going to just write the Sprite
  549. 20:50inside of the editable image I basically
  550. 20:51don't need this but let it be now let me
  551. 20:54press run as you see it processed our
  552. 20:55image and it displayed this right 7
  553. 20:58times per second yeah so that's how our
  554. 21:00animations look as you see my character
  555. 21:02got a little bit more animations you can
  556. 21:05look at the script of the character
  557. 21:07inside of the starter layer then you go
  558. 21:09to the character script and animator
  559. 21:11here you will maybe find something
  560. 21:12useful so let's go to another stand that
  561. 21:15is another great example how to generate
  562. 21:17an image for example let us open the
  563. 21:19script inside of it I'm generating the
  564. 21:21RGB image like you see when you picking
  565. 21:23the color let me show you an example if
  566. 21:25I press this color wheel you will see
  567. 21:27this rainbow image where you can pick
  568. 21:30the color of course you can make this
  569. 21:32image by yourself you don't need to go
  570. 21:34to Google and search for it because you
  571. 21:35can generated here I'm using the most
  572. 21:37useful function I've ever created then
  573. 21:39I'm looping through each pixel here the
  574. 21:41loop you saw earlier then I'm using the
  575. 21:43X and Y values to get the color of the
  576. 21:46image in that particular pixel so for
  577. 21:48example here you see from here to here
  578. 21:50I'm going to use the color space HSV
  579. 21:53that is hug saturation value you can
  580. 21:54read about this in the internet or here
  581. 21:56somewhere in the comments you can find
  582. 21:58the link then I'm going to use the
  583. 22:00faster function of converting HSV to RGB
  584. 22:03so I'm converting the X from Z to size x
  585. 22:05- one to range from 0 to 1 and the same
  586. 22:08thing for y but I'm converting to the
  587. 22:10range from 1 to zero that will be
  588. 22:12inversed so zero here will be one here
  589. 22:15you can read about this function here in
  590. 22:16the description then I'm converting HSV
  591. 22:19to RGB and I'm writing as well RGB and
  592. 22:22fully visible that is heavily coed of
  593. 22:24course you can just take a look at this
  594. 22:26so let me press a button if I press the
  595. 22:28button it takes some time but at the end
  596. 22:30I'm getting this small beautiful image
  597. 22:32yeah of course you can find it in the
  598. 22:34internet and you can do like a lot of
  599. 22:36analogs of the editable image but Isn't
  600. 22:38that cool you're generating your own
  601. 22:39image that thing taking the images from
  602. 22:42other person generate it if you have a
  603. 22:44good algorithm you can generate a cat
  604. 22:45okay let's take a look at the other
  605. 22:47stand the other stand is very special
  606. 22:50because it's a bonus recently I was
  607. 22:52curious about can I put like an image
  608. 22:54inside of Roblox without ever pling it
  609. 22:56for example to compress this image to
  610. 22:58convert it into string put it in Roblox
  611. 23:00not the image itself I'm putting the
  612. 23:02string just the normal text and then I
  613. 23:04reverse this text back to the image so I
  614. 23:06started my project on C++ right now let
  615. 23:09me show you of course the source code to
  616. 23:11that project you can find in the
  617. 23:13description on GitHub and of course you
  618. 23:15can find the link to that XE file so let
  619. 23:18me show you how it works the first you
  620. 23:20will have just XE file DL this thing I
  621. 23:22don't know whether I need to put this
  622. 23:24and the core after you run in this x
  623. 23:27file it will create create images and
  624. 23:28out two folders then you put every image
  625. 23:31you want to convert to string like two
  626. 23:33images in this case this will be YouTube
  627. 23:35icon subscribe or the format Webb it
  628. 23:38does support it if I run this I press in
  629. 23:40enter and it compiled my image 80 kiloby
  630. 23:44a great size if I open this image you
  631. 23:47will see you can read this image and you
  632. 23:49can like select the whole image and copy
  633. 23:51let me open the normal image for example
  634. 23:52I'm going to open this with notepad you
  635. 23:54will see a bunch of different symbols
  636. 23:57very scary ones that you always look at
  637. 23:59it and what the hell is this but the
  638. 24:01thing is you cannot copy like half of
  639. 24:03them not the half but a little bit less
  640. 24:06there's a symbol that you cannot copy
  641. 24:07and that's the problem because you will
  642. 24:09lose the data from that image and you
  643. 24:10will not be able to restore that's why
  644. 24:12you will see the image like this written
  645. 24:14in a fully readable text of course it
  646. 24:16takes a little bit more data and a
  647. 24:18little bit more computation to convert
  648. 24:20this to the readable text so I'm going
  649. 24:22to take the text I'm going to the stand
  650. 24:24and I put this image inside of this
  651. 24:27module script image as you see I put
  652. 24:29this 80 kiloby string inside of one
  653. 24:31single model script let me close it
  654. 24:33let's open the script of the Sprite and
  655. 24:35let's take a look how we can restore the
  656. 24:37image from the string of course you can
  657. 24:39find more description on the GitHub Link
  658. 24:41in the description so now when you
  659. 24:43require the model or the image it's
  660. 24:44going to return as a text it's going to
  661. 24:46be image 64 and then we need to decod it
  662. 24:49for this you can use a couple models
  663. 24:51that you will find here of course you
  664. 24:52can copy them bring them to your own
  665. 24:54place from this Z lip is open library
  666. 24:57and everything everything else is
  667. 24:58written by me so here first to recover
  668. 25:00the image I'm going to create editable
  669. 25:02image first then I'm going to put this
  670. 25:04image back to the normal string like it
  671. 25:07was from this B 64 then I'm going to put
  672. 25:09this string inside of the buffer so
  673. 25:11convert buffer to string after this I'm
  674. 25:13going to decompress this buffer it took
  675. 25:15a lot of steps because I had to put like
  676. 25:17the data from C++ to L and from L back
  677. 25:20to C++ yeah it was a little bit
  678. 25:22stressful then you're going to
  679. 25:23decompress the buffer this buffer
  680. 25:25utility is decompressed it's going to
  681. 25:27return the buff buff then you have to
  682. 25:28convert the buffer back to the string so
  683. 25:30read string from zero to length of
  684. 25:32buffer then you're going to again
  685. 25:34convert this from the base 64 and then
  686. 25:36you're going to create the buffer again
  687. 25:37with the string you decoded and there's
  688. 25:40one last step almost one last step you
  689. 25:42need to decode the image I used encoding
  690. 25:44of K it is recent algorithm of encoding
  691. 25:47images it is basically very fast to
  692. 25:49decode encode but you will achieve the
  693. 25:52size of the PNG and after I'm encoding
  694. 25:55Ki I'm compressing it with Z is very
  695. 25:58interesting one you like cutting the 70%
  696. 26:01of that image size but if I convert to
  697. 26:03this base it's going to again restore
  698. 26:06some size but it's not as big as
  699. 26:07original imager then I'm going to decode
  700. 26:09this buffer I need to put buffer here
  701. 26:11I'm going to get the data so that's
  702. 26:13again buffer I'm going to get the vids
  703. 26:15height channels and color space channels
  704. 26:17can be three or four that depends on
  705. 26:19original image but Q will always return
  706. 26:22four channels because it will be a
  707. 26:24little bit easier for you to write in
  708. 26:26the editable image so you don't need to
  709. 26:28like convert it back to the color 4 or
  710. 26:30something like that but it just gives
  711. 26:31you some information at how much
  712. 26:33channels does that image have okay then
  713. 26:35I'm going to create the image table so
  714. 26:38this is the buffer and we cannot write
  715. 26:39buffer inside of the editable image so
  716. 26:41I'm going to use this function I'm going
  717. 26:43to convert buffer to table and then I'm
  718. 26:45going to put parameter here to true
  719. 26:47because I'm storing the pixels from 0 to
  720. 26:49255 so as well encounter on that one if
  721. 26:52you want to like encode this image
  722. 26:53convert this in range from 0 to 255 and
  723. 26:56let it be in Tanger and floor this
  724. 26:58values so I'm going to put this through
  725. 26:59that's going to convert it back to from
  726. 27:010 to one it's going to convert to the
  727. 27:03normal range that editable image can
  728. 27:05read then I'm going just to write this
  729. 27:07image to the editable image so I'm going
  730. 27:10to press run and I'm going to test this
  731. 27:11stand okay let's press this button and
  732. 27:14let's see what happens subscribe of
  733. 27:16course you can do this the image
  734. 27:17encourages you that is basically I think
  735. 27:19the foundation of the new project I'm
  736. 27:20working on about video compression you
  737. 27:22will be able to compress the whole video
  738. 27:24put it in Roblox maybe you can do
  739. 27:26something small with normal image labels
  740. 27:29but it's only a string and you putting
  741. 27:31string to Roblox and you playing this as
  742. 27:33a video isn't that impressive I'm right
  743. 27:35now learning a couple other compression
  744. 27:37algorithms but that will be a little bit
  745. 27:39later when I release the new version
  746. 27:41that will be able to compress videos and
  747. 27:44maybe all stuff then you will be able to
  748. 27:46put this in Roblox yeah the Roblox
  749. 27:48prices are incredible 2,000 robox per
  750. 27:50video and three uploads per month oh my
  751. 27:52good I'm going to pay so let me explain
  752. 27:54how to use this XF file one XF file is
  753. 27:57not enough you need to install one C++
  754. 27:59Library called open CV so the link to
  755. 28:01that Library will be as well in the
  756. 28:03description it is going to look like
  757. 28:05this then you go get started then you're
  758. 28:07going to press on C++ this link make
  759. 28:11sure that you're installing
  760. 28:13490 maybe you watch this in the far
  761. 28:16future where we have flying cars where
  762. 28:19we superheroes flying on our costumes to
  763. 28:22work so
  764. 28:24so just make sure that you're installing
  765. 28:264.9 .0 you're going to need this EXA
  766. 28:30file then you need to install this
  767. 28:32Library I installed this library on the
  768. 28:34disk D here it is you open this Library
  769. 28:37you go to build x64 vc16 and then you're
  770. 28:41going to open the bean folder then you
  771. 28:44copy the pass to the beIN folder that is
  772. 28:47very important then you right click on
  773. 28:49the Windows button you go to system
  774. 28:52Advanced system settings need to open
  775. 28:55this thing Advanced system settings you
  776. 28:57open environmental variables you double
  777. 29:00click on pass after this you press in
  778. 29:02new and you put in the link of the beIN
  779. 29:05file you copy it here that is the same
  780. 29:07like pass as you see open CV build x64
  781. 29:11VC and Bin so you put it here you press
  782. 29:14okay okay and then you can use this
  783. 29:16program after this you just put
  784. 29:18everything you want to compress inside
  785. 29:20of the images and you press enter in
  786. 29:22this EXA program if you got like a lot
  787. 29:25of images you need to wait a little
  788. 29:27little bit until it starts to Sav in the
  789. 29:29images if it's done with image it's
  790. 29:31going to save that in the file that is
  791. 29:33going to be here you will find it here
  792. 29:35in the text file is going to have the
  793. 29:37same name so and for today that's it
  794. 29:39thank you for watching and hope you're
  795. 29:41doing great
  796. 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.