Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added GUIScripts/Text to Captcha Image/Images/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GUIScripts/Text to Captcha Image/Images/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GUIScripts/Text to Captcha Image/Images/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GUIScripts/Text to Captcha Image/Images/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GUIScripts/Text to Captcha Image/Images/5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GUIScripts/Text to Captcha Image/Images/6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GUIScripts/Text to Captcha Image/Images/7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions GUIScripts/Text to Captcha Image/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# ✔ TEXT TO CAPTCHA IMAGE
- ### A Text to Captcha Image is an image processing application created in python with tkinter gui.
- ### In this application user can select enter any text in the entry text area.
- ### And then will be able to convert that text to corresponding captcha image in different color and background.

****

# REQUIREMENTS :
- ### python 3
- ### cv2 module
- ### tkinter module
- ### messagebox
- ### from PIL import Image, ImageTk, ImageDraw
- ### from captcha.image import ImageCaptcha

****

# HOW TO Use it :
- ### User just need to download the file, and run the text_to_captcha_image.py, on local system.
- ### After running a GUI window appears, here user can see the option to enter text in the text area.
- ### After user has entered any text in the text area, when user clicks on the convert button, the corresponding captcha image with that text will be shown in the right side of window.
- ### Also for different time we get different color of captcha image.
- ### Als there is a clear button, clicking on which clears the text entered in the entry box.
- ### Also there is exit button, clicking on which we get a exit dialog box asking the permission to exit.

# Purpose :
- ### This scripts helps us to easily get the captcha image for any text and see the preview.

# Compilation Steps :
- ### Install python3, tkinter, cv2, PIL, captcha.image
- ### After that download the code file, and run text_to_captcha_image.py.py on local system.
- ### Then the script will start running and user can explore more by entering any text and converting it to the Captcha image.

****

# SCREENSHOTS :

****

<p align="center">
<img width = 1000 src="Images/1.jpg" /><br>
<img width = 1000 src="Images/2.jpg" /><br>
<img width = 1000 src="Images/3.jpg" /><br>
<img width = 1000 src="Images/4.jpg" /><br>
<img width = 1000 src="Images/5.jpg" /><br>
<img width = 1000 src="Images/6.jpg" /><br>
<img width = 1000 src="Images/7.jpg" /><br>
</p>

****

# Author :
- ### Akash Ramanand Rajak
6 changes: 6 additions & 0 deletions GUIScripts/Text to Captcha Image/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
libraries used : tkinter
from tkinter import filedialog
import tkinter.messagebox
from PIL import Image, ImageTk
cv2
captcha.image
82 changes: 82 additions & 0 deletions GUIScripts/Text to Captcha Image/text_to_captcha_image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

# Text to Captcha Image

# imported necessary library
import tkinter
from tkinter import *
import tkinter as tk
import tkinter.messagebox as mbox
from captcha.image import ImageCaptcha
import PIL
from PIL import ImageTk, Image
import cv2

#created main window
window = Tk()
window.geometry("1000x700")
window.title("Text to Captcha Image")

panelB = None
img = Image.open("Images/original.jpg")
img = ImageTk.PhotoImage(img)
if panelB == None:
panelB = Label(image=img)
panelB.image = img
# panelB.pack(side="right", padx=10, pady=10)
panelB.place(x = 600, y = 440)

# top label
start1 = tk.Label(text = "TEXT TO CAPTCHA IMAGE", font=("Arial", 50,"underline"), fg="magenta") # same way bg
start1.place(x = 55, y = 10)

# info label
start1 = tk.Label(text = "Enter any text \nand make Captcha Image", font=("Arial", 45), fg="green") # same way bg
start1.place(x = 140, y = 100)

# Text label
start1 = tk.Label(text = "TEXT", font=("Arial", 40), fg="brown") # same way bg
start1.place(x =190, y = 310)

# text Entry Box
text_entry = Entry(window, font=("Arial", 45), fg='orange', bg="light yellow", borderwidth=3, width=13)
text_entry.place(x=50, y=450)

# captcha image label
start1 = tk.Label(text = "CAPTCHA\nIMAGE", font=("Arial", 40), fg="brown") # same way bg
start1.place(x = 600, y = 280)

def convert_fun():
input_text = text_entry.get()
if(input_text==""):
mbox.showerror("Error","You entered NO text.")
else:
ic = ImageCaptcha()
ic.write(input_text,"Captcha_Image.jpg")
img = Image.open("Captcha_Image.jpg")
img = ImageTk.PhotoImage(img)
panelB.configure(image = img)
mbox.showinfo("Success","Captcha Image Created Successfully.")

# convert button created
convertb = Button(window, text="CONVERT",command=convert_fun,font=("Arial", 25), bg = "light green", fg = "blue", borderwidth=3, relief="raised")
convertb.place(x =100 , y =580 )

def clear_fun():
text_entry.delete(0,END)

# convert button created
clearb = Button(window, text="CLEAR",command=clear_fun,font=("Arial", 25), bg = "orange", fg = "blue", borderwidth=3, relief="raised")
clearb.place(x =450 , y =580 )

# function created for exiting
def exit_win():
if mbox.askokcancel("Exit", "Do you want to exit?"):
window.destroy()

# exit button created
exitb = Button(window, text="EXIT",command=exit_win,font=("Arial", 25), bg = "red", fg = "blue", borderwidth=3, relief="raised")
exitb.place(x =800 , y =580 )


window.protocol("WM_DELETE_WINDOW", exit_win)
window.mainloop()