 Hello everyone and welcome back to the Python image library module tutorial video series That's a tongue twister and today we're gonna be jumping into the put pixel function now the put pixel function is handy But also slow so that's kind of why I wanted to introduce to you guys and talk to you about it And I'm surprised I haven't showed it to you earlier because I actually use this quite a bit in a lot of the Python challenge videos so Put pixel will do pretty much exactly what it says it puts a pixel onto the image it takes a position argument which is typically a tuple of an X and Y coordinate and It takes a color which is often at least tuple for multi-band images like RGB or RGB a for Red green and blue and the alpha value so if you've got a Single band image that only takes one value like black or white that sort of thing You would only pass in one integer But in our case we're gonna be working mostly with multi-band images like red green and blue and red green blue and alpha So that's why we will do that now. I do want to caution you with this put pixel function because it is very very slow The documentation Stuff that I've been checking out online, which I totally recommend you do do some research and reading on your own But it specifies that version 1.1.6 of this image Python image library and the module The load function will actually get into pixel access objects And I'll show you that in a coming tutorial But pixel access objects are much much faster at actually using get pixel and put pixel Which are the two functions at least put put pixel. I'm showing you now, but get pixel I showed you earlier so put pixel of course works kind of like the reverse of get pixel Get pixel is going to retrieve pixel and color like information from the image and put pixel is going to put Pixel and color information on the image So if you're gonna do this a lot if you're gonna put a lot of pixels on the screen It's actually a lot better to use put data Which of course I showed you get data earlier and I've said get pixel is kind of the Opposite of put pixel and put pixel the opposite of get pixel put data is pretty much the same thing for get data Takes a Python list and then you use put data to slap it on the image and of course for more extensive changes you can probably use the pace function which I've shown you earlier and Even on top of that you should be using image draw Which is another module that hopefully I'll get into very very soon and in later videos But that's what you should be using rather than put pixel But of course for educational purposes and for me wanting to show you because it's I don't know the internet I want to show people stuff We're gonna go through put pixel. So what I'm gonna do is actually loop through my image for X in range of width and I know that my image is a square because I've been working with this the entire series We could is just as easily say for why in range of height The range is really only one that matters here, but I know it's like a value 200 whether or not it be width or height So I'm just gonna use X and I'm gonna use the same thing for X and Y coordinates so that way it's essentially drawing a line and Of course is gonna need our color 0 0 0 and I'm gonna use 255 for my alpha value now if I run this You can check it out What it's done is it has successfully essentially drawn this line because it's called the put pixel function Over and over and over again with our loop So this is slow, but it gets the job done And I've actually used it a lot in the Python challenge videos along with get pixel but in a real programming scenario where I actually care about time and efficiency and speed and It's much more Recommended to use pixel access objects, which I'll get into very very soon, but thank you guys for watching anyway I hope you enjoyed this and I'll see you in the next tutorial