Although I'm familiar with Python, your method of pedagogy is just fabulous and it is seriously criminal that you neither have the views nor the subscribers that you actually deserve. But I do see a great future for this channel and I will be a silent cheerleader for your channel's success 🙌 👍
Thank you! I really appreciate hearing that feedback. Also - I had to look up what "pedagogy" means (for anyone who doesn't know, it's "the method and practice of teaching").
I didn't overlook how skillfully you defined if __name__ == '__main'. You wouldn't (maybe you would) believe how many tutorials and articles fail to execute on this definition effectively and succinctly. Nice tangential value add!
For anyone doing it using the most up to date PIL version you'll need to change the resize and antialias line to something like this image = image.resize((target_size_px, target_size_px), Image.ANTIALIAS) Great content BTW!!!
10.0.0 removed ANTIALIAS and replaced it with LANCZOS. The new line is image = image.resize((target_size_px, target_size_px), Image.Resampling.LANCZOS)
Masterpiece, and it is seriously criminal that you neither have the views nor the subscribers that you actually deserve But best of luck for the future. we need more videos about generating NFTs from base characters by python coding ..please...please.Love from PAKISTAN
Thank you and noted! I will probably do a technical deep dive video on what I learn about NFTs as well so maybe that would fit in there. For GPT-3 stuff, I have another video that explores the API a bit more (using poetry and creative writing: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-r3zKcL0iGeA.html)
Thanks! It's a K2 Keychron wireless compact. It looks nice on the desk but I actually prefer a larger layout. The keys are MX-Cherry Red. They're OK to type with. Personally I think blue-switches are the most satisfying, but it's probably too loud for the video (and for my house mates).
Hasta yo lo entendí y no sé inglés wtf eres muy bueno! estoy empezando en Python y no manejo ni 1% de ello pero tú lo haces muy fácil quiero ser como tú ☺️
That's amazing! I can't read Spanish so I used Google translate to read your message. Thank you, I'm glad the video made sense for you and I look forward to sharing more awesome stuff in the future.
is a pleasure watch you program! I understand a little bit of python, my head explodes but is like watching you do art! thank you!, can you make a video showing how to use OpenAI GPT-3 To name the files? thanks
Thank you! I plan to do more art-coding videos soon. I have two other videos on Open AI (one is a generic exploration of its ability, the other one "Build an AI-driven SaaS" actually shows more hands-on how to use Open AI. The way I used it to generate names isn't too different from what I did in that latter video.
Good tutorial for learning python and indeed image drawing/manipulation in python but I'd loose the NFT from the title because this doesn't cover anything about how to make NFTs... only images.
That's a good suggestion - but the actual project code does have an NFT deployment contract included. It just wasn't used or covered because ETH gas fees were really expensive :( I kept the title because I think it helps people with the intent to generate NFT art discover this more easily.
Thanks! As for your question - do you mean like have an image be used to generate a variety of different images? Or use one image and publish it as several different NFT tokens? Either way, both are possible. But what would your intention be behind this?
Have you ever done a video on using parameter hints? As a new programmer, this is one of the things that I find very frustrating. I know there's good information in the popup, but I don't know how to use it effectively.
Yup, I have one on dataclasses (using type-hints): ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-9B9CdKANjnM.html and one using Pydantic as well: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-XIdQ6gO3Anc.html
I didn't do anything special to be able to code 'seamlessly' (actually I still get stuck and make lots of mistakes). I think it just comes with time. Just focus on the problem or want to solve, or the idea you want to build, and don't worry whether you code fast or slow. Also, for these tutorials, I usually prototype the whole idea first before I start recording. So when I'm recording it, I already know which direction I'm going to go. If I do actual live-stream of me coding, you'll see me pause and go back-and-forth a whole lot more.
@@pixegami Understood. I started coding about 6 months ago and I guess it does get a little bit easier overtime, there's just so much to learn that it can feel overwhelming. Have your NFT's found some buyers, or were you just doing this as sort of a project?
The pip doesn't work on my MacBook, I have installed few ways but still doesn't work and also my python version says 2.7 on the vscode even though I have installed 3.9 from the python website, any help would be appreciated.
Ah ok, it looks like you need to first spend a bit of time understanding and setting up virtual environments in Python. The reason `pip` doesn't work for you isn't because you are on MacOS, but because you are the OS's system version of Python. When we work on projects, we don't want to use or modify the system Python (that's for the OS to use). We need to download and setup our own version and environment for it. That's how you can get 3.9 and pip. Here's more on virtual environments: docs.python.org/3/library/venv.html Also, when you use Python in VSCode, you can choose *which* Python environment you are using. It sounds like by default it's chosen your system Python 2.7, but ignored you newly installed 3.9. You can change it to use that instead. Check here: code.visualstudio.com/docs/python/environments
First a big thanks for this tutorial! I've actually been inspired by your work here and had a go head-first into the NFT world with a similar code! But do have question @line 100 in your GH code: "next_point = points[i + 1]" - could possibly explain the technicality behind this iteration? I do understand what it does :) but not HOW it does it... cause if you print out "i" you'd get the correct iteration number w/ the next iteration's value... Later Edit: you can disregard the question if you want, got it! :)
I’m not 100% sure if this was the question you are asking, but I’ll talk about it anyway in case others have the same question. So the “i+1” part of the iteration is to get the ‘next’ point in that list. In order to draw a line, we need two points. So to join a list of points together, we join points n and n+1.
I use VSCode as my IDE (I also use PyCharm for bigger projects, but these days VSCode is good enough). I don't use Anaconda, but I do sometimes use conda (with pip) as a package manager.
Here is the full version: github.com/pixegami-team/machine-psychology-python-art Here is the one I used in the tutorial: github.com/pixegami/python-generative-art-tutorial
Yup, this is just VSCode (available for free) without any plugins. VSCode can render images, so I just made that a separate window, and it refreshes when the image changes.
Can anyone please explains to me how the part that connects all the dots works? I have tried to understand all the functions but cant seem to figure it out.
If we have a list of dots (x, y), then we can use the PIL draw.line() method to draw lines between the points. I suggest reading the doc and trying it out with a smaller set of points first to get a better understanding: pillow.readthedocs.io/en/stable/reference/ImageDraw.html#PIL.ImageDraw.ImageDraw.line
Oh dear, did I forget to include that? I have another video where I actually use GPT-3 in more detail, so you can get a sense of the technology and API there: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-yxyyYMWu1ZA.html (see the chapter about Open AI). And though not covered in the tutorial, my full project is also available on GitHub. The naming script is there: github.com/pixegami-team/machine-psychology-python-art/blob/main/src/art_name_generator.py
This usually means that your list doesn't have an element at index "i+1". To debug, you can use a breakpoint to check what the contents of that list are (look up how to use breakpoints in Python). Or simpler, just print the list out before you try to access that index (for a more brute force approach).
Python is just for generating the images. OpenSea is for uploading them (or using as a marketplace) - so the two technologies aren’t mutually exclusive.
This is because you need to install "pillow" (the Python imaging library) into your environment. If you think you've already installed it, but still get the error - it means the place you installed it is different to the place you are running this script. You can read more about that if you just search Google for something like "managing packages in Python" or "setting up an environment in Python."
VSCode as my IDE. For terminal, it’s just the regular Ubuntu terminal app, using zshell as the shell, and OhMyZsh plugin with a modified Agnoster theme.
Question: I've followed this tutorial up to 11:38 step by step. But there is one issue, every time i keep running the program, it doesn;t draw the line at all, even if I mess with the "image_bg_color" variable it wont change the picture, it continues to save a blank image. Am i doing something wrong? or is it something else that im overlooking?
Alright, so after some testing, turns out that its not saving a new image, it keeps the old archive, hence why its only showing a white square. Now the question is, the program doesn't show any problem and it "runs" with no compilation issues, but it's not overwriting the previous archive in order to show the new one...
Thank you for this!! but can anyone help me with this? I get an error when I run it: Exception has occurred: TypeError join() argument must be str, bytes, or os.PathLike object, not 'NoneType' During handling of the above exception, another exception occurred: File "C:\Users\Home\Downloads\python-generative-art-tutorial-main\src\generate_art.py", line 42, in generate_art output_dir = os.path.join('output', collection) File "C:\Users\Home\Downloads\python-generative-art-tutorial-main\src\generate_art.py", line 135, in generate_art(collection_name, f"{collection_name}_image_{i}")
@@kryptoknight742 Heyy, I think I have found the solution because now it runs successfully. But I forgot what line the error is in. Can you tell me the line of code that gets you an error?
@@gemcapistrano same as yours mate. I strayed from scratch and it relates to the batch editing. So I’m just doing 1 at a time haha. Changing the name in the script. Easy enough 👍🏻
It’s hard to debug an error without seeing the full stack-trace or code, but the error message “Exception has occurred … NoneType” tells me that one of the values you are passing is `None` to os.path.join(). My debug approach would be to check each of the values I’m about to pass in and see which is `None`.
I don’t even know how to use Blender, so I can’t make a tutorial about it yet - but from what I know about modelling and coding in general, I’m 100% sure it is possible.
If you mean 3D art, it's also just a data file at the end of the day, so you can probably write a Python program to generate 3D models and textures. But this tutorial specifically won't really give you useful information on how to do that (maybe unless you adapt the points to 3D space and plug it into a modelling/rendering tool).
Haha, well…Technically this is just automating image generation. “Art” itself is probably in the perspective of the viewer, and I don’t know if that can ever be automated.