JavaScript Pixel Manipulation for Beginners

  Рет қаралды 34,205

Franks laboratory

Franks laboratory

Күн бұрын

Пікірлер: 182
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
How was your week. This is another of my attempts to get you excited about coding with JavaScript. Have fun. Click the LIKE please :)
@ShayanBinShad
@ShayanBinShad 4 жыл бұрын
Thank you so much for this tutorial!
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Thanks Will, happy to hear that :D
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Hi Shadow, glad to know you like it :D I have more free time on my hands these days
@CoolScratcher
@CoolScratcher 4 жыл бұрын
Trying this soon :D
@MuSic-kl3pd
@MuSic-kl3pd 3 жыл бұрын
Thank you so much for this tutorial.
2 жыл бұрын
I only wanted to know how to identify a pixel but then I found this quite interesting and of really great quality
@yeshayavarghese350
@yeshayavarghese350 4 жыл бұрын
I just found out about your channel and I wish I would have found it sooner! I didn't know a lot of stuff pure js can do. Amazing advanced tutorials, great job!
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Hi Yeshaya, I'm happy you found me :) Pure JS can do a lot, I hope to explore much more in future videos. Thank you for taking the time to leave a comment.
@javisleon4179
@javisleon4179 3 жыл бұрын
This is the stuff I need! Been getting into JavaScript and it's these type of projects that make me continue to dive in and see what the possibilities are! Thanks Frank.
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
Really? Thank you for letting me know Javis, I'm happy that you found this inspiring in some way :)
@francisnyasinga9064
@francisnyasinga9064 Жыл бұрын
dude you are purely amazing..
@Aaackermann
@Aaackermann Жыл бұрын
Great video and wonderfull approach to break down the topic and teach it! Thank you so much!
@tomask2138
@tomask2138 4 жыл бұрын
beautiful tutorial, thank you, it's really clear. I 'm already waiting for the next one ( :
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Happy to hear this feedback, thank you Tomas
@nazirkhan5467
@nazirkhan5467 4 жыл бұрын
the speed and the clarity with which you teach is super Crystal clear
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Hi Nazir, I'm happy to hear a feedback like this, thank you!
@ShayanBinShad
@ShayanBinShad 4 жыл бұрын
To be honest, this video deserves 1M likes! This is great!!! O-O
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Thank you Shadow, you always support my content :)
@stamrepo
@stamrepo 4 ай бұрын
Wow! Impressive. Very cool, man.
@DrSurfman
@DrSurfman Жыл бұрын
This is awesome!! Thank-you!!
@EstebanArias_
@EstebanArias_ Жыл бұрын
Thank you very much for this tutorial!! ♥
@Frankslaboratory
@Frankslaboratory Жыл бұрын
Hi Esteban, I'm here to help :)
@markpx
@markpx 4 жыл бұрын
Excellent instruction! You read my mind about what I wanted to figure out.
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
I think starting from the basic concept is a good way to get people on board because sometimes I get complains that the effects are too complex. Thanks for nice feedback Mark
@zeroOeffect
@zeroOeffect 2 жыл бұрын
you flipping rule! ty so much, I love it.
@abdullahkhan-pr1ip
@abdullahkhan-pr1ip 2 жыл бұрын
I didn't skip any ads in your video. you deserve. it
@jeremymelix1935
@jeremymelix1935 4 жыл бұрын
Awesome tutorial Frank. I Knew about pixel manipulation but had no idea how to do it, and it wasn't something I was looking into. I am self taught and started trying to learn everything I could about the JavaScript language after learning the basics of several languages. I am more recently learning game development. I had no drive to mess with pixel manipulation until I saw the remarkable programs you built with it. Everything in coding involves a learning curve or memorization of built-in methods when learning a API , framework, or library. I didn't know some of the canvas api's built-in methods, such as getImageData(). Looking forward to watching more videos on pixel manipulation. Your an exceptional developer and this channel is simply phenomenal. Thank you so much, I am learning a lot.
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Hi Jeremy, it's always nice to see a comment from you. Thank you for being supportive. I'm learning about new things that can be done as well, and trying to combine them in interesting ways. I discovered a couple of very cool tricks I want to make tutorials on, just need to come up with a good project. Are you saying that after trying many languages you settled on JavaScript or are you still undecided?
@jeremymelix1935
@jeremymelix1935 4 жыл бұрын
Hi Frank, Oh no I don't see myself using any other front end development language anytime soon Plus I have already invested to much time into JavaScript. Its a beautiful expressive versatile language. I learned the basics of Java and a few others. There is so much to learn in JavaScript alone that I don't think I will be looking at becoming an expert in any other language anytime soon. But I do need to eventually pick one or two server side languages. I was thinking node.js since its just JavaScript and PHP or Python. I need to revisit SQL as well. Eventually, I would like to be able to combine front end , server side, and database languages to build an online game . For now, my focus is just to get a HTML5 mobile game developed that's download worthy. A game that only needs session or local storage to store a high score and game state. I am getting close but not quite there. Although I understand the language very well using it to build complex applications is very different. Its like saying that because one can write then they must be able to write a great book or best seller. I did take your game and do quite a bit with it. Built a separate small abstract engine, One-off canvas object, and moved some methods to where they were better suited for what I was doing. I added new methods. I added a loadImage, loadAssets, update, and loadHandler methods to a Game object. I added a health bar that looses health when bubbles hit the top of canvas and changes color from green to red when it hits 50% . The bar disappears when there is no more player health , the game state freezes, and a Game over message is displayed. I also have a state for winning when the score gets to a certain point. I was going to post this code, but I felt it was too long. Like this message. I was thinking of doing a video for this code while promoting your page, but I don't want to do you tube videos right now. I have to find a quite place, get into the mind set, and it takes time. Anyhow your tutorials are awesome and you explain stuff with such clarity and charisma. You could teach courses on Udemy if you don't already. Your tutorials are better than most the videos I watch on Udemy.
@henrmota
@henrmota 4 жыл бұрын
I have 10 years of experience I even do things with shaders but you earned a new subscriber.
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Hi Henrique. Thank you for taking the time to comment, nice to meet you. You are much more experienced than me, I hope to get to that level of programming experience one day. What kind of projects do you build with shaders?
@henrmota
@henrmota 4 жыл бұрын
@@Frankslaboratory hehe the important thing is to have fun. Great tutorials man, even for experienced developers.
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Thank you Henrique, very kind. It means a lot to get this kind of feedback from an experienced dev. If you ever see something in my code that can be simplified or better explained please let me know. I am still learning how to make my videos more accessible for beginner programmers.
@BibleTechNutt
@BibleTechNutt 3 жыл бұрын
I am fascinated by how much beauty can be made by using Canvas and need to strengthen my portfolio so I am doing it by following these tutorials, I started to go with Pixel-rain tutorial of yours but had some trouble with the PNG tool so I came to something a bit more beginner. I want to get better at javaScript and get a job but have trouble getting motivated but HTML5 Canvas has kind of changed that so I am looking forward to learning with you!!
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
It can be hard to focus on studies during difficult times like this. That's why it's good to pick up fun project like particles or gamedev once in a while. Hopefully it will keep you motivated. Good luck with your coding Jason. :)
@BibleTechNutt
@BibleTechNutt 3 жыл бұрын
@@Frankslaboratory Thanks very much! I am building out a client's site from scratch right now!. Thanks for the encouragement! I'll need another Canvas break after this LOL
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
@@BibleTechNutt I love building sites from scratch, can be a lot of work especially when you get to mobile/table styles etc. Good luck!
@BibleTechNutt
@BibleTechNutt 3 жыл бұрын
@@Frankslaboratory Every new layout I learn how to create is one more I can use for the next customer! I started getting excited the first time someone put it to me like that. I like it WAY better than trying to build with any website builder. As someone who learned to code HTML and CSS before EVER touching a site builder, they confuse me still lol.
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
@@BibleTechNutt I have never used site builder, not sure how they work. It gives you great work experience building from scratch, eventually you could be the person building site builders haha. I'm sure these tools are great when you want something quick, and they are improving them all the time, but building from scratch and understanding how it works will always win.
@cirusMEDIA
@cirusMEDIA 2 жыл бұрын
Video begins at 2:56
@aidanbenbow6682
@aidanbenbow6682 Жыл бұрын
It is a good tip about the image load event listener. I spent all day trying to draw an image without this!
@Frankslaboratory
@Frankslaboratory Жыл бұрын
Yea it's very important and it is a source of problems ha
@AhmedElrhazi
@AhmedElrhazi Ай бұрын
What series a beginner like me should follow? I am new to CSS, HTML5 and JavaScript. Thanks a lot for your creative efforts!
@sagar-tt4ub
@sagar-tt4ub 4 жыл бұрын
I really like the way you explain things.
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Hi Sagar, how are you. I try to explain things properly in videos I mark 'for beginners' like this one. I'm glad you noticed :)
@sonodrome
@sonodrome 4 жыл бұрын
You're the best Frank! Thanks for all these amazing tutorials, they are super informative and fun :)
@sonodrome
@sonodrome 4 жыл бұрын
If you get the chance, check out my latest HTML/JS experiment here: sonodrome.co.uk/permute
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
This is so cool, I love coding experiments like this. Did you use vanilla JS or is there a good library for effects like this
@sonodrome
@sonodrome 4 жыл бұрын
@@Frankslaboratory It's all vanilla, just using HTML5, Canvas and webAudio API
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
@@sonodrome Love it, I will try to create some sound art effect with my next particle systems video, let's see what comes out of it :D
@sonodrome
@sonodrome 4 жыл бұрын
@@Frankslaboratory That would be awesome! It's really cool being able to synchronise and create relationships between audio and visual elements, there's so much potential and I look forward to seeing more of it on the web.
@albedobond3827
@albedobond3827 3 жыл бұрын
Thank you for your all tutorials!!
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
Thank you for letting me know you found some value here. I will try to make more content like this
@robertkabuusu1084
@robertkabuusu1084 2 жыл бұрын
wonderful tutorial. great work. Makes things easy to understand.😄
@uddiptalukdar
@uddiptalukdar 2 жыл бұрын
Great teaching. Subscribed.
@bargeosch6427
@bargeosch6427 3 жыл бұрын
Very nice. Your videos make coding fun and interesting. Thanks for making these.
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
You have been going through my library, thank you for leaving nice feedback like this ❤
@markpx
@markpx 4 жыл бұрын
Please post part 2 of this as soon as you can!
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Hi Mark. I want to make sure its the best possible quality. Will release it soon :)
@tegaogheneovo5881
@tegaogheneovo5881 2 жыл бұрын
King King , I got you thank you very much, subscribed 😎
@akashchokshi2283
@akashchokshi2283 4 жыл бұрын
Hello, first of all, your videos are fabulous. Especially, when you explain every line of code. Can you please create a tutorial to code an image editor with features like zoom and pan the images drawn on the canvas?
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
Akash! thank you so much for a lovely comment. Yes I like this idea, putting it on my to do list. Thank you for letting me know what content you are looking for
@miteshchoudhary8499
@miteshchoudhary8499 4 жыл бұрын
Eagerly waiting for part 2
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Hi Mitesh, part 2 is in the works :)
@joakimwretlind4016
@joakimwretlind4016 3 жыл бұрын
Hi Frank! Yes, you can put viruses in images. Thanks for great tutorials!
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
That's what I was afraid of :D No idea how virus in image would work, but it's good to be aware of it.
@sojuthomas7727
@sojuthomas7727 3 жыл бұрын
Amazing,great tutorial,Thank you so much
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
Hi, glad you liked it, I am working on more effects using this technique, ASCII art etc
@deepakbhargav7434
@deepakbhargav7434 3 жыл бұрын
Thank you for the series
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
Glad you like it Deepak :)
@sachin_6335
@sachin_6335 3 жыл бұрын
Love your tutorials. learned a lot from these tutorials. Keep making, thanks! Can you please make a tutorial on falling confetti with vanila js.
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
Sachin! Thank you so much you are very kind. I will make some confetti effects, good idea
@yashsharma6112
@yashsharma6112 2 жыл бұрын
Great teaching skills ❤️
@Frankslaboratory
@Frankslaboratory 2 жыл бұрын
Thank you Yash ❤️
@amirrezaranjbar2853
@amirrezaranjbar2853 3 жыл бұрын
Intro 10/10
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
Thank you :D
@nicholarucitadhamma6000
@nicholarucitadhamma6000 2 жыл бұрын
Is it just me who's experiencing this? I can't set the scannedImage.data = scannedData. The console said that scannedImage.data is a read only property meaning that I can't set the value of that property
@gopinathkrm58
@gopinathkrm58 4 жыл бұрын
Hair glittering animation at 1:45 is so nice
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Hi Gopinath. I was playing with some variations. This one turned out quite nice. Thank you
@gopinathkrm58
@gopinathkrm58 4 жыл бұрын
@@Frankslaboratory do u have that
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
@@gopinathkrm58 what do you mean
@gopinathkrm58
@gopinathkrm58 4 жыл бұрын
@@Frankslaboratory I mean which video are u doing that kind of animation
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Oh. I havent released tutorial for that. Its variation on particle rain effect I show off in this video a lot. The base effect will be the second part of this video when I finish it
@watermelonice4487
@watermelonice4487 4 жыл бұрын
Please make a video on how to make mobile controls for javascript game.. like gba controls.. moving forward,backward,left,right
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Hi Doraemon, that's a great idea, I did episode where you can control game character with keyboard arrows, I will do more of that but also maybe clickable controls on screen would be interesting to try
@eddujoel2514
@eddujoel2514 3 жыл бұрын
Gracias, te amo.
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
🙏🙏❤
@JM-de2gh
@JM-de2gh 4 жыл бұрын
OK, that was some pretty cool stuff -- thanks Frank! "What is it you like about creative coding?" @ 2:26 - I'm the first answer. Are you the third answer, Frank?
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Hi Jon, how do you know me so well. For me it is the third one and also the first one. I make a lot of mistakes as well as any student and this is a good practice for me.
@chomok-bd
@chomok-bd 2 жыл бұрын
Wonderful
@marcinkalmar9964
@marcinkalmar9964 2 жыл бұрын
great video
@jeteloriaga
@jeteloriaga 3 жыл бұрын
sorry, frank, but sometimes i get so engrossed in your tutorials from beginning to end that i forget to hit like XD
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
Hi Jet, you are forgiven hahaha. Thank you for watching my videos, hope to see some of your creative projects in the future :)
@geloh1
@geloh1 2 жыл бұрын
Had the Cross origin issue. I was able to get it working by starting Chrome with the --allow-file-access-from-files option
@Frankslaboratory
@Frankslaboratory 2 жыл бұрын
Hi Angelo, thank you for sharing, cross origin issues can be tricky to deal with
@olygood
@olygood 4 жыл бұрын
i love tuto
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Thanks Oly, nice to meet you
@RbyLearning
@RbyLearning Жыл бұрын
You are Amzing
@Frankslaboratory
@Frankslaboratory Жыл бұрын
Thank you :)
@0Xmo
@0Xmo 2 жыл бұрын
hi sir, hope u doing will i have a question howcan i get all pixels for same color in image and then remove this color or change it to white
@joakimwretlind4016
@joakimwretlind4016 3 жыл бұрын
If you use vsCode and get the message "Tokenization is skipped for long lines for performance reasons. The length of a long line can be configured via `editor.maxTokenizationLineLength`." 1. Go to Settings (cogwheel bottom left -> settings) 2. Type 'max' in the search bar at the top 3. Two steps down you will find 'Editor: Max Tokenization Line Lenght' By default, this is set to 20'000. Add for example a 1 in front of this and you should be good to go :)
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
Hi Joakim, this is a great point, thank you for sharing your knowledge with us!!
@scottonanski4173
@scottonanski4173 4 жыл бұрын
Hey, Frank. Why not set the body to "{ display: flex; }'", with {align-items: center;}, and {justify-content: center;} to center the canvas? Or is this just a personal preference?
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Hi Scott, this is a great suggestion thank you. In my job I have to support old internet Explorer, so I guess it became a habit to avoid flexbox, because some of it's properties won't work in Internet Explorer. But for tutorials like this with experimental modern JavaScript code it doesn't really make sense for me not to use it. Thank you for a useful comment, I will try to remember that in the future :)
@nazirkhan5467
@nazirkhan5467 4 жыл бұрын
can you please increase the font size so that people viewing on mobile finds it easier to follow your video
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Hi Nazir, the video I just released still has small font size, but I will keep that in mind and increase it for the next ones
@tarun7617
@tarun7617 4 жыл бұрын
More pixel manipulation !!!! Awesome 👍 !! This time it's also on a big scale , cool !! And I have finally done with my game , I just ended up adding weird ai I.e. which player car hit the other car it bump toward other side and have it's speed decreased ..... I need to study a ton more , to start making some decent games .... It's gonna sometime
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Its good to have a project like that, with your game. It motivates you to learn new coding tricks. Some game mechanics can be tricky to implement if you try to figure it out yourself. Most has already been invented so sometimes its good to look at other peoples code. Even if its in a different programming language. The logic will work the same
@tarun7617
@tarun7617 4 жыл бұрын
@@Frankslaboratory I'll love to try new things , even if it gives weird result , I like to do crazy stuff
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Me tooo :D Weird stuff is the best :D
@tarun7617
@tarun7617 4 жыл бұрын
@@Frankslaboratory HAHAHAHA , SO true 😂😝
@0xdeadbeef131
@0xdeadbeef131 2 жыл бұрын
Hey great video! Question. I want to store imageData rgb array and use it after it is loaded OUTSIDE load function. So i came up with this code : (inside constructor of class named "BitmapBase64") this.width = 0; this.height = 0; const sprite = new Image(); sprite.src = data; sprite.addEventListener('load',function(){ this.width = sprite.width; this.height = sprite.height; m_context.drawImage(sprite,0,0,sprite.width,sprite.height); const scannedImage = m_context.getImageData(0,0,sprite.width,sprite.height); this.pixels = scannedImage; console.log(this.pixels); }); I tried to store data to pixels but it is undefined when i try to access it. let sprite = new Bitmap('**put base64 text here**); console.log(sprite.pixels); //undefined what am i doing wrong?>?
@marleenloohuis2111
@marleenloohuis2111 3 жыл бұрын
Solved it by viewing the site in Xammp localhost
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
Hi Marleen, awesome. glad you found it!
@marleenloohuis2111
@marleenloohuis2111 3 жыл бұрын
Thanks for making this awesome videos. I was looking for an intro to JavaScript gamedevelopment. I liked the first video so much, I want to see the whole playlist.
@mohsol86
@mohsol86 3 жыл бұрын
thanks!
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
You are welcome Mohammad :)
@albedobond3827
@albedobond3827 3 жыл бұрын
Could you make a video about fluid simulation with Navier-Stokes equation???! Sir
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
Like this? www.outpan.com/app/44bdd9869c/interactive-fluid-simulation I would love to make this one yea
@albedobond3827
@albedobond3827 3 жыл бұрын
@@Frankslaboratory Yess!!! Wow that app is fantastic o.O
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
@@albedobond3827 Yes, the code seems complex, will try to break it down to see if it can be simplified. I'm not familiar with this technique yet
@albedobond3827
@albedobond3827 3 жыл бұрын
@@Frankslaboratory You should!! Thank your for your kind answering😍😍👍
@alishata8
@alishata8 Жыл бұрын
Actually Creative Coding was my first passion when I came to programming
@Frankslaboratory
@Frankslaboratory Жыл бұрын
Amazing. Glad to hear I'm not alone like that. You are talented I saw your work
@alishata8
@alishata8 Жыл бұрын
This means a lot to me, thank I consider you as my inspiration and when I feel depressed I just take one of your courses to give me the portion of motivation I need@@Frankslaboratory
@Андреич-с4н
@Андреич-с4н 3 жыл бұрын
At 8:13 I run into an error: Uncaught DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data. at Image. (file:///F:/JS_test/Pixel_Manipulation/script.js:12:27)
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
If you keep watching I explain how to fix it in the next couple of minutes. Sorry I structured the video in a way that this error happens at first
@Андреич-с4н
@Андреич-с4н 3 жыл бұрын
Thanks, Frank. This text string looks ugly but is seems to be a powerful tool to control every single pixel. I gues this allows to perform some computer vision tricks like pattern recognition?
@ale711
@ale711 3 жыл бұрын
Ty
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
I'm here to help
@sapolio1538
@sapolio1538 3 жыл бұрын
Isn't there a chance to get data right from the image, skipping the step of drawing it within the canvas element?
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
Hi Aleksandr. Probably there is a way to do that, code can do anything, but not with canvas API because getImageData will get pixel information from canvas element so the image needs to be drawn on canvas for its pixels to be analysed.
@codingawarenes
@codingawarenes 2 жыл бұрын
Where is the part 2 plZ anyone can give me link?
@giancarloandrebravoabanto7091
@giancarloandrebravoabanto7091 Жыл бұрын
converting base64 is like putting all the image weight into the code. even is more heavy. is there another solution?
@Frankslaboratory
@Frankslaboratory Жыл бұрын
Hi, I don't think it makes the code heavier, since the image code needs to be loaded before any JavaScript that depends on that image can run. It doesn't make much difference if that image code is in .js file as base64 data string or if it's read directly from .png file. It has no effect on performance. If you want to use this technique with image files, if you point src attribute to that image it will work, if the image and code file sit on the same server. It will not work locally on an offline machine, since that will trigger CORS.
@marleenloohuis2111
@marleenloohuis2111 3 жыл бұрын
What to do with error: Uncaught DOMException :The operation is insecure? When console logging scannedImage.
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
Hi Marleen, did you manage to solve it? I assume you are doing something different than me in the video, most likely running it though server or something right?
@BlOups_13
@BlOups_13 Жыл бұрын
I have à problem at 7:48 it say Uncaught DOMExeption: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': the canvas has been tainted by cross-origin data I dont understand ... I am french that not help me 😂
@Frankslaboratory
@Frankslaboratory Жыл бұрын
I address that problem if you keep watching the video
@yeshayavarghese350
@yeshayavarghese350 4 жыл бұрын
Is there a way to get the pixel data in hex code or would you have to convert rgba to hex using js?
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Hi Yeshaya, the pixel data array contains 0-255 values so you would have to convert it, the algorithm to convert rgba to hex is quite simple css-tricks.com/converting-color-spaces-in-javascript/
@yeshayavarghese350
@yeshayavarghese350 4 жыл бұрын
@@Frankslaboratory Thank you so much! I tried making an image filter tool with this tutorial. It would be awesome if you could check it out in your free time and give me feedback. codepen.io/steelshot/pen/LYZJmGR
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Wow you made it into interactive colour shift project with colour picker and everything. I wish I had this idea before making this tutorial, haha. Would have built something like that instead. I followed you on Codepen. This is actually a nice project for coding portfolio as well.
@yeshayavarghese350
@yeshayavarghese350 4 жыл бұрын
@@Frankslaboratory wow! Thank you😄
@Андреич-с4н
@Андреич-с4н 3 жыл бұрын
The line 14: const scannedData=scannedImage.data; and the line 18: scannedData[i]=averageColorValue; should produce an error - an attempt to modify a constant. But they work. What am I getting wrong?
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
Hi, this will not produce an error since you are no reassigning const variable to a completely different value, you are just modifying values within that same array. Assigning const variable doesn't freeze array completely. Const cannot be reassigned but can be modified.
@Андреич-с4н
@Андреич-с4н 3 жыл бұрын
@@Frankslaboratory I see. Thank you
@EDMVibes24
@EDMVibes24 3 жыл бұрын
@@Frankslaboratory thanks I had the same doubt
@aaendi6661
@aaendi6661 3 ай бұрын
I tried to make a PNG file in MSPaint, but it keeps giving a "cross origin" error when I try to get data.
@Frankslaboratory
@Frankslaboratory 2 ай бұрын
You get cross origin errors when you use an image file locally on your computer combined with GetImageData method. It's expected. This is an old video, I'm sure I explain and cover how to deal with that in the video itself.
@Redes-Antisociales
@Redes-Antisociales 3 жыл бұрын
Frank! I love your videos, Thank u ! I don't know why I get this error: Uncaught DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data. at Image. My JS CODE: const canvas = document.getElementById('canvas'); const ctx = canvas.getContext('2d'); canvas.width = 425; canvas.height = 600; const image1 = new Image(); image1.src = './Dua.png'; image1.addEventListener('load', function(){ ctx.drawImage(image1, 0, 0, canvas.width, canvas.height); const scannedImage = ctx.getImageData(0, 0, canvas.width, canvas.height); console.log(scannedImage) })
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
Hi. I address this issue if you watch 5 more minutes into the video. Let me know how it goes:)
@Redes-Antisociales
@Redes-Antisociales 3 жыл бұрын
MAN FUCK HAHAHAHAHA When I got this error, I paused the video and I start a big research to fix it, when I fix the problem, I start the video again, and in the next seconds you explain the error... hahahaha, I passed 3 hours searching how fix this and you explain to me it in 3 minutes, your videos are amazing
@pluscday2
@pluscday2 3 жыл бұрын
you have adjusted 2 loops into 1 loop which is much better now.
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
Hi Alex, 1 loop is always better yes, I try to do it when possible, unless doing that requires too much explanation and the tutorial is aimed for beginners. Sometimes I choose to be less optimal if it means the video is easier to understand
@ultimatechallenge540
@ultimatechallenge540 3 жыл бұрын
Can you make tetris game using circle ball If color of three of 3 ball is same in horizontal or vertical the ball will disappear Anyone ?????
@EDMVibes24
@EDMVibes24 3 жыл бұрын
Hai Ultimate Challange Am a Web Game Developer
@ultimatechallenge540
@ultimatechallenge540 3 жыл бұрын
@@EDMVibes24 Just try this and let me know
@startail007
@startail007 4 жыл бұрын
超強
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Thank you, although I can't really read traditional Chinese :)
@hou-yawang516
@hou-yawang516 4 жыл бұрын
@@Frankslaboratory it means "that's so impressive!" :D
@sadamhussain9176
@sadamhussain9176 4 жыл бұрын
At last you like aliens unique tutorial
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
HI Sadam, happy you like the tutorial, I am trying to bring more creative coding on KZbin
@devHarshit
@devHarshit Жыл бұрын
the thumbnail-
@Frankslaboratory
@Frankslaboratory Жыл бұрын
What's wrong with it 😅
@rdawo6408
@rdawo6408 Жыл бұрын
🥹😍
@harknesswolf3526
@harknesswolf3526 4 жыл бұрын
Your videos are wonderful. I figured out your particle trick, and how to set up a GitHub repo if you want to take a look: github.com/Bad-Wolf-42/particle-painting I don't know if it's okay to post links to my own stuff in comments. If not, then I apologize. I had a lot of fun making this. Thank you.
@Frankslaboratory
@Frankslaboratory 4 жыл бұрын
Hi Wolf. Thank you for your feedback. Impressive. It seems you came up with a different solution to the same problem. You are good, this is not easy to do. Thank you for sharing. You can post anything in comments, sometimes KZbin puts it in spam folder because it contains a link but I check it once in a while and approve the comments. I think the solution you came up with is actually better than mine :D
@MuSic-kl3pd
@MuSic-kl3pd 3 жыл бұрын
lol
@Frankslaboratory
@Frankslaboratory 3 жыл бұрын
😀
Learn HTML Canvas: Pixels & Physics 🎨
1:17:00
Franks laboratory
Рет қаралды 146 М.
Vanilla JavaScript Pixel Rain Tutorial
33:27
Franks laboratory
Рет қаралды 69 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 86 МЛН
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 6 МЛН
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 116 МЛН
Turn Off the Vacum And Sit Back and Laugh 🤣
00:34
SKITSFUL
Рет қаралды 10 МЛН
HTML5 canvas: изучаем основные свойства, рисуем графики | HTML, CSS, JS
21:23
Елена Литвинова — Искусство Веб-разработки 🛸
Рет қаралды 17 М.
Coding Challenge 166: ASCII Text Images
22:42
The Coding Train
Рет қаралды 1,1 МЛН
Learn Creative Coding: Paint Brushes & Complex Shapes
33:58
Franks laboratory
Рет қаралды 48 М.
Canvas - Images and Image Data - Episode 4
16:49
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 21 М.
Build an Image Gallery with Vanilla HTML, CSS, and JavaScript
22:54
James Q Quick
Рет қаралды 22 М.
ASCII Art with Vanilla JavaScript
41:25
Franks laboratory
Рет қаралды 55 М.
Учим HTML5 Canvas за 30 минут!
36:56
Хауди Хо™ - Просто о мире IT!
Рет қаралды 213 М.
JavaScript 2D Game Tutorial
44:42
Franks laboratory
Рет қаралды 173 М.
Particle Text with Vanilla JavaScript
1:22:18
Franks laboratory
Рет қаралды 39 М.
Build a Pixel Art Canvas with JavaScript
32:32
dcode
Рет қаралды 11 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 86 МЛН