Skip to main content

Posts

How to Draw Reels Logo in Python

 You know that after banning tictok in India Instagram introduce us to reels. It becomes very popular today it also holds great weight for users. So let's create reels using python Code: from turtle import * speed ( 100 ) bgcolor ( '#fb3958' ) pencolor ( 'white' ) pensize ( 10 ) penup () goto ( 100 , 100 ) pendown () left ( 180 ) forward ( 150 ) for i in range ( 90 ):     forward ( 1 )     left ( 1 ) forward ( 150 ) for i in range ( 90 ):     forward ( 1 )     left ( 1 ) forward ( 150 ) for i in range ( 90 ):     forward ( 1 )     left ( 1 ) forward ( 150 ) for i in range ( 90 ):     forward ( 1 )     left ( 1 ) penup () for i in range ( 90 ):     backward ( 1 )     right ( 1 ) left ( 90 ) pendown () forward ( 259 ) penup () right ( 180 ) forward ( 85 ) left ( 120 ) pendown () forward ( 60 ) right ( 120 ) penup () forward ( 100 ) right ( 60 ) pendown () forward ( 60 ) penup () goto ( 5 ,- 20 ) left ( 60 ) right ( 90 ) pendown () for i in range (

Python | Background Subtraction using OpenCV

 Background subtraction is any technique that allows an image's foreground to be extracted for further processing Many applications do not need to know everything about the evolution of movement in a video sequence, but only require the information of changes in the scene, because an image's regions of interest are objects(humans, cars, text, etc) in its foreground. After the stage of image processing(which may include image  denoising , post-processing like morphology, etc.) object localization is required which may make use of this technique So let's create this most valuable project with python so easily. Modules: OpenCV Numpy Code: import numpy as np import cv2 cap = cv2 . VideoCapture ( 'walking.avi' ) # Initlaize background subtractor foreground_background = cv2 . createBackgroundSubtractorMOG2 () while True :         ret , frame = cap .read()     # Apply background subtractor to get our foreground mask     foreground_mask = foreground_background .app

Draw Minecraft Charater in Python

  Minecraft  is a  sandbox video game  developed by the Swedish video game developer  Mojang Studios . The game was created by  Markus "Notch" Persson  in the  Java programming language . Following several early private testing versions, it was first made public in May 2009 before fully releasing in November 2011, with  Jens Bergensten  then taking over development.  Minecraft  has since been ported to several other platforms and is the  best-selling video game of all time , with over 238 million copies sold and nearly 140 million  monthly active users  as of 2021 . We gonna build a character of Minecraft using our creativity and coding skills so let's drive into the code: Code: import turtle as t def eye ( r , a ):     t . fillcolor ( 'brown' )     t . begin_fill ()     t . circle ( r , a )     t . end_fill () t . begin_fill () t . fillcolor ( '#8a00e6' ) t . penup () t . goto ( 0 ,- 50 ) t . pendown () t . right ( 90 ) t . f

Walking Cat Animation using Pure CSS and HTML

  Showing your creativity with coding is really awesome and fun. This is the post where the creativity is the CSS. So enjoy the code and try to show your creativity. HTML: <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta http-equiv="X-UA-Compatible" content="IE=edge">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>walking Cat</title>     <link rel="stylesheet" href="style.css"> </head> <body>         <div id="marco">           <div id="cielo"></div>                 <div id="luna"></div>                 <div id="gato"></div>                 <div id="muro"></div>                 <div id="edificios"></div>         </div> </body> </html> C

How to Controll Screen Brightness Using yourHand detection in Python Using OpenCv

 Control your screen brightness by just using your two fingers is really cool. You may see this kind of technology in scientific movies now you can make it using OpenCV with the help of python.  Modules: OpenCV: for recognizing images math: for detecting the distance of your fingers screen_brightness_control: for controlling the brightness of your system mediapipe: for detecting hands  numpy: for play with arrays Code: import cv2 import mediapipe as mp from math import hypot import screen_brightness_control as sbc import numpy as np   cap = cv2 .VideoCapture( 0 )   mpHands = mp . solutions .hands hands = mpHands .Hands() mpDraw = mp . solutions .drawing_utils   while True :     success , img = cap .read()     imgRGB = cv2 .cvtColor( img , cv2 .COLOR_BGR2RGB)     results = hands .process( imgRGB )       lmList = []     if results .multi_hand_landmarks:         for handlandmark in results .multi_hand_landmarks:             for id , lm in enumerate ( handlandm

How to Draw Python logo In Python

  We will see that how we can draw a python logo with the help of python itself. It gonna be fun to see that python is building python itself. So let's drive into the code Modules: In this post, we will use one popular module that is turtle Code: from turtle import * speed ( 100 ) pencolor ( '#4584b6' ) fillcolor ( '#4584b6' ) begin_fill () penup () goto (- 70 , 20 ) left ( 180 ) pendown () forward ( 10 ) for i in range ( 50 ):     forward ( 0.5 )     right ( 1 ) for i in range ( 80 ):     forward ( 2 )     right ( 1 ) for i in range ( 50 ):     forward ( 0.5 )     right ( 1 ) forward ( 130 ) left ( 90 ) forward ( 10 ) left ( 90 ) forward ( 90 ) right ( 90 ) forward ( 30 ) for i in range ( 50 ):     forward ( 0.5 )     right ( 1 ) for i in range ( 80 ):     forward ( 2 )     right ( 1 ) for i in range ( 50 ):     forward ( 0.5 )     right ( 1 ) forward ( 80 ) for i in range ( 90 ):     forward ( 0.5 )     right ( 1 ) forward ( 120 ) for i in

How to Draw Pepsi Logo in Python

  Pepsi is a popular drinking soda you also drink this in your daily life. But why do we want to create this logo in python because creating such drawing things and easy things keep you motivated to keep going in the coding field and everyone draw it with pencils and you will draw it by computer using python it looks cool. Code: import turtle as t t . pencolor ( 'white' ) t . circle ( 150 ) t . penup () t . circle ( 150 ,- 48 ) t . pendown () t . fillcolor ( '#C9002B' ) t . begin_fill () t . pencolor ( '#C9002B' ) t . circle ( 150 ,- 163 ) t . left ( 105 ) for i in range ( 10 ):     t . forward ( 30 )     t . right ( 5 ) t . forward ( 9 ) t . end_fill () t . pencolor ( 'white' ) t . left ( 180 ) t . right ( 70.9 ) t . penup () t . circle ( 150 , 4 ) t . pendown () t . begin_fill () t . fillcolor ( '#004B93' ) t . pencolor ( '#004B93' ) t . circle ( 150 , 170 ) t . left ( 160 ) for i in range ( 40 ):     t . forward ( 4 )     t .