@@Canttakethatback Ascii characters hight and width are not equal. Hight is about 1.65 times bigger than width - depending on display. So to compensate that, i added / 1.65
This is video is great. I have been critiquing my coding in an attempt to improve, and my style is similar to yours and works very well for clean clear writing and editing but doesn't seem to be the norm. I think that people could learn a lot from you. Thank you.
Great tutorial. But you often just type and run over what you type quickly with absolutely no explanation as to what it is, so I'm left feeling like I just copied a code manually rather than learned something new.
Really cool video! Would it be possible for you add a simple animation to visually explain what you are doing. Since i often find myself replaying parts of the video to get an idea what the code you wrote does. Anyway, I recently found your channel, and i'm really enjoying your videos.
The main function is kinda sketchy. Three level function argument passing doesn’t look that good. Anyone have that PEP reference for this? Thaf list comprehension compromises readability.
Hi, I keep on getting the error "not a valid pathname to an image" as well as "UnboundLocalError: local variable 'image' referenced before assignment Any help please?
Hi Kite, I’m trying to use a livestream webcam, possibly around 1 sample per second, and covert the text in a defined region to ASCII to be stored in a csv. I’m very very new to python and so I’m wondering if you know how I might go about that
I get the following result: "new_image_data = pixels_to_ascii(grayfy(resize_image(image))) UnboundLocalError: local variable 'image' referenced before assignment"
I managed to get work with image sets, as an animation of ASCII characters. I added a few more input variables like number of images and image type, and added a frame delay so that it would print to the console with distinct frames instead of being to fast for the human eye. The animation frames will just go on loop, because I though it would be underwhelming if it just showed the animation one time.
Thanks for the reminder! We've added our repo link in the description. Here's the link for this project: github.com/kiteco/python-youtube-code/tree/master/ascii
Ok, so I followed everything and I also had to install PILLOW module because PIL.Image is not an pre-installed package. And I also run the program and it runs smoothly but when showing the output it basically does nothing but show some dots, it looks nothing like the image I entered. I dont know why this is happening. Is it because I am using IDLE interpreter? If anyone knows why this is happening do let me know
All it does is that it keeps saying "'import' is not recognized as an internal or external command, operable program or batch file." I've followed everything else in the tutorial, but I'm really frustrated with the end result being nothing
In case you are still lost, you need to install a Python interpreter. There are many interpreters for Python, and I personally use the IDLE interpreter.
// is the operation for floor divison. This guarantees that we get an integer as the result. So "pixel//25" divides the intensity of the pixel by 25 and rounds it to the smaller integer. The important thing to notice is that he is using the result of "pixel//25" (e.g. let's say 3) to choose an element from the list of ASCII charachters he made earlier (so in our example, it would choose the 4th element, which is "%"). This is also why ASCII charachters were listed in descending intensity at the start.
how do I make the lines larger than 100 characters, I tried changing this line larger than 100 but that didn't make a difference. resize_image(image, new_width=1680): any thoughts on how to make this bigger ?
You can technically choose anything as long as your ASCII character list is 1 + 255//the_number_you_chose long. Example: If you do floor division by 50, you would need an ASCII character list that has 6 elements. If you do floor division by 10, you would need an ASCII character list that has 26 elements. What changes is the details. Also, finding 26 ASCII character that reasonably decrease in intensity would be too hard.
I am 5 months late, but here it is (copy of my previous comment): // is the operation for floor divison. This guarantees that we get an integer as the result. So "pixel//25" divides the intensity of the pixel by 25 and rounds it to the smallest integer. The important thing to notice is that he is using the result of "pixel//25" (e.g. let's say 3) to choose an element from the list of ASCII charachters he made earlier (so in our example, it would choose the 4th element, which is "%"). This is also why ASCII charachters were listed in descending intensity at the start.
bro can you please help me I am getting an issue: "C:\Users\MY BOOK\Documents\thumb-1920-606500.jpg is not a valid pathname to an image." bro I am stuck here please help me with a valuable info. your projects are really cool I am liking it quite a lot.
How i made this into a .exe with a graphic interface? Anyone knows what i need to use to do? And i will ger with python language? - i tried to think in make a site and attempt to convert to exe but idk if work
I love this guy and how he precisely comments the code speaking. But I also hate him because he reminds me so much of the college humor guy (the voice). And I hate that guy (jake & amir).
I save the project and images in a folder, but when I want to open the image there is a message ril.jpg is not a valid pathname to an image. can you help me?
I would like to ask How can I add a comment that can be printed along with the image or after the image? Also, can I compile this Python code into a exe file?
If you guys made it to the comments, let us know what images you turn (or want to turn) into a ASCII art!
it works so good!!
I don't know how to put images in comments using UA-cam, but it's so fine !! good job man!!
I got my script working after a long time.But it works really great.
:-)
I have a problem showing in sublime. It is showing :-
AttributeError: 'NoneType' object has no attribute 'convert'. I am using ubuntu
@@humptydumpty6323 can you please share your full trace back message?
Great tutorial! To maintain the image aspect ratio in ascii format i modified the ratio line of code:
ratio = height / width / 1.65
Thank You!
worked for me thanks! but what does 1.65 stand for
@@Canttakethatback Ascii characters hight and width are not equal. Hight is about 1.65 times bigger than width - depending on display. So to compensate that, i added / 1.65
With value 2 it's much better
@@Canttakethatback How do you actually do this? I tried to do a image of a celebrity to make my friend laugh. But when I copy n paste it doesnt work
That worked out perfectly for exactly what I needed. Big time thank you!
is not a valid pathname to an image. (Solved)
In the first line change
import PIL
to
from PIL import Image
and in line 29 remove this
PIL.
Dude it still doesn’t work, I’m not sure what I’m doing wrong
@@niterider3622 the image and the code should be in same folder
@@DoubleFL3X there isn't a need tho lmao
winner here!!
Thanks
This is video is great. I have been critiquing my coding in an attempt to improve, and my style is similar to yours and works very well for clean clear writing and editing but doesn't seem to be the norm. I think that people could learn a lot from you. Thank you.
you went a little too fast but after making youtube play it at 0.75 speed this tutorial was amazing, thanks
definitely
Was thinking about this few weeks ago wondering how it's been done
Likewise bro, but animated
When I try to copy n paste a image it doesnt work
Such an underrated channel
You deserve better
interesting quick weekend project to tinker with. thank you!
Great tutorial. But you often just type and run over what you type quickly with absolutely no explanation as to what it is, so I'm left feeling like I just copied a code manually rather than learned something new.
Hey could you help? I'm having trouble with the import PIL.Image. I've tried looking everywhere and see no info about how to get it to work
Really cool video!
Would it be possible for you add a simple animation to visually explain what you are doing. Since i often find myself replaying parts of the video to get an idea what the code you wrote does.
Anyway, I recently found your channel, and i'm really enjoying your videos.
can you please upload it in github?
**sees doge on thumbnail**
me be like: I. MUST. CLICK. THE. MYTHICAL. DOGE
im getting invalid path names, even though I copy the absolute pathname/ path from content root into the command prompt
same
what do you mean, how do i fix this
@@SalvettiRocco You need to write "from PIL import Image"
@@quahmingjun7246 You need to write "from PIL import Image"
@@gabrielesolms7048 You need to write "from PIL import Image"
The main function is kinda sketchy.
Three level function argument passing doesn’t look that good. Anyone have that PEP reference for this?
Thaf list comprehension compromises readability.
Thanks brother! this really helps me!
Great tutorial! Thank you
For the aspect ratio to work you need to account for the character dimensions.
I'd recommend to slow down the tutorial, because this guy is a speech machine
i agree... i'm a beginner, and... i am so lost, how do people talk so fast :(
I have an error that says "Unable to import 'PIL.Image' " and there was an unused variable 'image' what did I do wrong to correct it?
try running it using python3.9 or just install the module
Hi, I keep on getting the error "not a valid pathname to an image"
as well as "UnboundLocalError: local variable 'image' referenced before assignment
Any help please?
insira a linha:
from the PIL import image
insert the line:
from the PIL import image
Replace with this line :
Hi Kite, I’m trying to use a livestream webcam, possibly around 1 sample per second, and covert the text in a defined region to ASCII to be stored in a csv. I’m very very new to python and so I’m wondering if you know how I might go about that
I get the following result:
"new_image_data = pixels_to_ascii(grayfy(resize_image(image)))
UnboundLocalError: local variable 'image' referenced before assignment"
I also
Can you tell me how to fix this
@@harmandeepsingh935 I'm affraid I can't. I'm sorry.
@@gabri3ltz its ok bro
make sure you return the image
more py tutorial, already subs
it keeps saying invalid path for image even though the image is in same folder , I also give it full path.. help?
Same here - have you found a solution?
Thank you Kite!
it just says that it's not a valid pathname to an image even though i use .jpg
Did you find a fix?
Try putting the image in the same folder as the code.
try from PIL import Image.
@@khwaishtongia1687 i tried every fix, but didn't worked!
same problem here
does this work in IDLE python?
I managed to get work with image sets, as an animation of ASCII characters.
I added a few more input variables like number of images and image type, and added a frame delay so that it would print to the console with distinct frames instead of being to fast for the human eye.
The animation frames will just go on loop, because I though it would be underwhelming if it just showed the animation one time.
I did cd desktop but it said that the system can’t find the given path
@That Coder ty
UnboundLocalError: local variable 'image' referenced before assignment
someone can help me??
it was great, super cool library. thxs
What a great tutorial. Please share the Github link
Thanks for the reminder! We've added our repo link in the description. Here's the link for this project: github.com/kiteco/python-youtube-code/tree/master/ascii
Cool stuff!
im getting a few errors saying it has no attribute convert or getdata
my brain cells explode after watching this
Hey my image paths dont seem to be working for some reason any fixes?
Replace with this line :
it shows this ModuleNotFoundError: No module named PIL.image, though i have pillow installed in my system.
same problem did you find a fix?
youtube sent me notification today(5days later)😒😒 wtf UA-cam
Thank you
Ok, so I followed everything and I also had to install PILLOW module because PIL.Image is not an pre-installed package. And I also run the program and it runs smoothly but when showing the output it basically does nothing but show some dots, it looks nothing like the image I entered. I dont know why this is happening. Is it because I am using IDLE interpreter? If anyone knows why this is happening do let me know
PIL not working... Can anyone help?
Awesome!
Tysm :D
Very good!
Line 37??
All it does is that it keeps saying "'import' is not recognized as an internal or external command,
operable program or batch file."
I've followed everything else in the tutorial, but I'm really frustrated with the end result being nothing
In case you are still lost, you need to install a Python interpreter. There are many interpreters for Python, and I personally use the IDLE interpreter.
This sounds like you haven't properly set up python.
Nice guide!
But what does 'pixel//25' stand for? When join method iterates through 'pixels' which type does 'pixel' get?
Thx a lot.
// is the operation for floor divison. This guarantees that we get an integer as the result. So "pixel//25" divides the intensity of the pixel by 25 and rounds it to the smaller integer. The important thing to notice is that he is using the result of "pixel//25" (e.g. let's say 3) to choose an element from the list of ASCII charachters he made earlier (so in our example, it would choose the 4th element, which is "%"). This is also why ASCII charachters were listed in descending intensity at the start.
@@gecicihesap901 Thanks for explaining when i changed ammount of ASCI chars i got error.
@@vojtechsokala3611 No problem, mate!
It says PIL.image module does not exist
you figure out how to install PIL?
@@cheems24 nope
how do I make the lines larger than 100 characters, I tried changing this line larger than 100 but that didn't make a difference.
resize_image(image, new_width=1680): any thoughts on how to make this bigger ?
I wasn't able to install Kite. My CPU is not supported. Do I have any other option please?
have u found the solution?
How do u know that u need to do a floor division by 25?
You can technically choose anything as long as your ASCII character list is 1 + 255//the_number_you_chose long. Example:
If you do floor division by 50, you would need an ASCII character list that has 6 elements.
If you do floor division by 10, you would need an ASCII character list that has 26 elements.
What changes is the details. Also, finding 26 ASCII character that reasonably decrease in intensity would be too hard.
3:14 can someone please explain the [ASCII_chars[pixel//25]] part please?
I am 5 months late, but here it is (copy of my previous comment):
// is the operation for floor divison. This guarantees that we get an integer as the result. So "pixel//25" divides the intensity of the pixel by 25 and rounds it to the smallest integer. The important thing to notice is that he is using the result of "pixel//25" (e.g. let's say 3) to choose an element from the list of ASCII charachters he made earlier (so in our example, it would choose the 4th element, which is "%"). This is also why ASCII charachters were listed in descending intensity at the start.
@@gecicihesap901 wow thanks so much. You helped me a lot
@@konstantineendeladze9029 No problem, mate! I am studying computer science, always a pleasure to help others who want to learn it.
Can you help me solve one error about : import "PIL.Image" could not be resolved from source Pylance(reportMissingModuleSource) [1,8]
Plz help me I have a error saying "local variable 'image' referenced before assignment
image is created in the try statement, check the output to see if the exception is printing
good job!
Hey man, how would I do a python request for a url and pull an image of a chemical structure in the terminal? is it possible?
thanks
Idk if you're on linux, but I use wget and "url" in the terminal.
can i initialize utf32 / unicode too . if it is what should write
actually i hav an issue
the resize function is not working quite right..my ascii is as tall as a giraf
bro can you please help me I am getting an issue:
"C:\Users\MY BOOK\Documents\thumb-1920-606500.jpg is not a valid pathname to an image."
bro I am stuck here please help me with a valuable info.
your projects are really cool I am liking it quite a lot.
In the first line change
import PIL
to
from PIL import Image
and in line 29 remove this
PIL.
@@DoubleFL3X Thaaaanks!!! This fixed the error
@@DoubleFL3X not fixing tho
I keep getting a ModuleNotFoundError for PIL. What shoudl I do?
How i made this into a .exe with a graphic interface? Anyone knows what i need to use to do? And i will ger with python language? - i tried to think in make a site and attempt to convert to exe but idk if work
use kivy for that
Use tkinter and pyinstaller
Pyinstaller need to be installed first.
After that convert the program using pyinstaller
Nice tutorial. But i have a question, why does the ascii pixel is divided by 25?
Found answer?
Grayscale values are 0 - 255. You want to map that to 10 characters.
@@dancetothemusic99 isn't it 11 chars?
@@abhaynambiar271 Ah yes, 11 characters. Flat dividing any 0 to 255 by 10 will give you 11 results INCLUDING zero.
@@dancetothemusic99 ahhh that makes sense thanks
Hey sorry for the ignorance, but when i run the script it tells me no module named 'PIL'. This is my first time in Python so my bad haha.
same here. did not find a solution
run pip install PIL
how to print it with color?
You can't
I have a problem showing in sublime. It is showing :-
AttributeError: 'NoneType' object has no attribute 'convert'. I am using ubuntu
def main(): not working. Just says its invalid syntax
by the time i wrote 'import PIL.Image', you already completed the try block! Please try to type a bit slower
Dont work for me
I love this guy and how he precisely comments the code speaking. But I also hate him because he reminds me so much of the college humor guy (the voice). And I hate that guy (jake & amir).
NameError : le nom 'image' n’est pas défini
I save the project and images in a folder, but when I want to open the image there is a message ril.jpg is not a valid pathname to an image. can you help me?
Done.
how to fix this.?
Hello bro, it says that "is not a valid pathname to an image." when I try to put. "picture.jpg" (this is the real name of picture)
@Chiba Liba I tried that but didn't worked!
same, i use ubuntu 20.04
In the first line change
import PIL
to
from PIL import Image
and in line 29 remove this
PIL.
@@DoubleFL3X thanks bro its working
@@DoubleFL3X Thanks man it worked!
Ascii to image when?
Line 27: path = input("Enter a valid pathname to an image:
")
^
IndentationError: expected an indented block remove this 27?
indent it
Can we Try it Out in Android Devices in Pydroid3?
I would like to ask How can I add a comment that can be printed along with the image or after the image? Also, can I compile this Python code into a exe file?
I added the print() statement. Can this code be compiled with pyinstaller?
That was awesome ...👏👏👏👏
🙌 thank you!
Can anyone explain why do we devide pixels over 25?
What if, at the end, I want to export to Jpg or Jpeg instead of .txt? thanks !!
ascii is an format of characters that you type in, like these ones i am so there is no way u can do .jpg or .jpeg
Here is a challenge , do it in google colab
Please tell me how can i get a pathname
I have an error! it says ' ModuleNotFoundError: No module named ' PIL ' ' - if someone can help me, that would be great. thanks
sudo pip install Pillow
📌⚠Hey guys, I find out a solution for the ERROR: ------ is not a valid pathname to an image. All you have to do is Replace with this line :
My program is not even opening.....why?
Wait, i don't understand that //25
when i try to run code it says ModuleNotFoundError: No module named 'PIL'
referring to the import PIL image how do i get this to work
In the command line write:
cd [here the path to the folder where your python file is]
And then:
pip install PIL
@@jonathanf680 where is the command line
@@xavierang3186 powershell or CMD
am i just slow or something i have him at 0.25 speed and i still cant follow hes so fast
Can I just copy paste all this please? I'm not interested in coding and typing all this myself seems pointless
write from PIL import Image instead of import PIL
у меня что то не работает я не могу ему скормить картинку которую хочу преобразовать в ascii
Nice
😩 Why dis be complicate just want hampter Text impress meme people🥺
Why I get this error?``` list index out of range```
Your ASCII character list doesn't have enough elements
OR
You forgot to do floor division
Thanks for replying but i figured out that my list had 1 element short 😅
does kite support Notepad++?
kite has been discontinued
Awesome 👍
Why not uploaded AI and ML videos
You might enjoy this one! ua-cam.com/video/FE_oAQ5FzMk/v-deo.html
how do i get PIL
neat
i used the one on your git repo, gave it an image and it wont work
same :(
solved it write from PIL import Image instead of import PIL, then solve the warning that should appear
asdf.jpg is not a valid pathname to an image.
Holy fuck I'm going insane
In the first line change
import PIL
to
from PIL import Image
and in line 29 remove this
PIL.
is not a valid pathname to an image It says this
can someone give me the python file plz