Had some time before college starts, made a video to ASCII converter in C.
Idk why OBS is dulling out the colours ;-;
Btw I've set my terminal font size to the minimum for max clarity.
Terminal used: kitty
Idk why OBS is dulling out the colours ;-;
Btw I've set my terminal font size to the minimum for max clarity.
Terminal used: kitty
Idk why OBS is dulling out the colours ;-;
Btw I've set my terminal font size to the minimum for max clarity.
Terminal used: kitty
How does this work?
An Image is made up of pixels. Each pixel has its own RGB value, which ranges from 0 to 255. R, G, B: 0,0,0 represents black, and all values set to 255 represent white. So we extract this image data using a library called stb_image. Then, we use it to calculate the brightness for each character and then print each character to our terminal using a nested loop.
btw I've set my terminal size to minimum for better quality, and I resized the image beforehand. I'll try to transform it into a video to ASCII converter before Monday.
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
int main(int argc, char *argv[])
{
int width, height, channels;
//Extracting image data.
unsigned char *imgdata = stbi_load(argv[1], &width, &height, &channels, 0);
if(imgdata == NULL){
printf("Error loading image!\n");
return 1;
}
char brightness_ramp[] = " .,-~:;=!*#$@";
int ramp_length = strlen(brightness_ramp);
//Calculating brightness and printing character to screen.
for(int i = 0; i < height; i++){
for(int j = 0; j < width; j++){
unsigned char r = *imgdata++;
unsigned char g = *imgdata++;
unsigned char b = *imgdata++;
//Calculate grayscale brightness.
float avg = (r+g+b)/3;
// Assign character according to its brightness.
int ramp_index = (int)(ramp_length * (avg/255.0f));
//Escape sequence for adding colour.
printf("\033[38;2;%d;%d;%d;48;2;%d;%d;%dm",r,g,b,0,0,0);
//Print character to screen.
putchar(brightness_ramp[ramp_index]);
}
putchar('\n');
}
return 0;
}
Don'ts:
- Smoking, drinking, drugs, impregnating.
- Unnecessary fighting and arguing with stupid seniors.
- Beefing with professors.
- Ignoring CGPA.
- Crying over your past mistakes.
- Being introverted. (Yes, it limits your growth)
- Partying and hanging out all the time.
- Trying to fit in with people you don't like.
- Ignoring Projects and just grinding DSA.
- Learning just for the sake of getting a job.
- Chasing trends.
Do's:
- Be humble asf.
- Switch to Linux and rice it. If you're a beginner, remove Windows and install Arch Linux manually, it's the easiest option for switching. Learn vim for extra aura.
- Learn touch typing.
- Learn to do online research.
- Start using books and docs for learning stuff. (Use lectures when they are of high quality)
- Be curious asf. Whenever a question comes to your mind, head straight to an LLM and ask it.
- Use LLMs for learning stuff and breaking down complex topics. If you don't understand a particular concept, tell it to explain like you're a five year old. You can also generate questions to test your understanding.
- Explore every domain of CS in your first year. You should at least have a basic idea about everything.
- Build crazy ass fundamentals.
- Learn basic C++ and start DSA. Just 1 hour every day.
- To fall in love with CS, you'll have to understand computers first; do that.
- Build the habit of project based learning. You learn something -> implement it immediately.
- Start fucking around and finding out.
I can't remember anything more rn, will keep updating this post. I'll make a highly curated resource list after some time. Btw this post is not for promotion but you can follow me on twitter (link is on my profile) only if you want to.
A request for seniors: Please make more quality posts here.
>!I myself am a junior.!<
Got this for Rs. 65k / 690$.
Pros:
- Good battery life (around 6-7 hrs for my work (CS UG))
- Good build quality. I saw a video on YouTube for the same laptop, but the build quality was shit, and there was a LOT of keyboard flex. So I was a bit scared about the quality, but it turned out to be surprisingly good, and there was no keyboard flex at all.
- Keyboard feels really good; my typing speed increased on it lol.
- Trackpad is nice and responsive.
- Hinge quality is great (It can't be opened with 1 hand).
- And lastly, as a previous 2016 model TN panel monitor user, I think the screen is great.
Cons:
- The top lid is a fingerprint magnet.
- I think 60hz refresh rate is a bit low but okay.
You guys can ask any questions you have.
Ik it ain't perfect but atleast it looks like a doughnut and it spinsssss
Dr. Stone Anime - the world gets destroyed and a scientist builds everything again from scratch.
The Thinking Game - a documentary on how google deepmind solved protein folding and the game of Go using AI.
A crash course about history of CS
How does a computer work from scratch?
Whispering ASMR for goooood sleep
Tell me about some more interesting stuff
Pls go easy on me😭
learnt the lyrics btw:)
(I'm a guy btw)
criteria -
I was getting this laptop for 25k just 2 weeks ago, before summer bonanza sale started. And now they have increased it by 25k?? Man wtf😭
Should wait till August? I want to purchase this for uni.
I was getting this laptop for 60k just 2 weeks ago, before summer bonanza sale started. And now they have increased it by 25k?? Man wtf😭
bataoo bataoo
Rating rating
A remarkable achievement by 7-year-old swimmer Ishank from Dhurwa, Ranchi, is drawing national attention after he reportedly became the youngest person in the world to swim across the Palk Strait. According to reports, Ishank completed the approximately 29-kilometre stretch from Talaimannar in Sri Lanka to Dhanushkodi in India in 9 hours and 50 minutes on April 30, 2026.
The challenging route, known for unpredictable sea conditions, has long been considered a major endurance test even for experienced swimmers. Ishank’s feat has been celebrated as an extraordinary display of determination, stamina and discipline at such a young age, with many hailing it as a proud sporting milestone.
I have to buy a laptop under 70k for my btech which should be durable, upgradable and able to handle all the workload involved. I don't think I need a dedicated GPU, one of my seniors recommended to use cloud stuff for cs stuff requiring gpu. And I don't play games.