Professional Documents
Culture Documents
BACHELOR OF INFORMATION
TECHNOLOGY
(2019- 2022)
Submitted by
K. DEEPIKA
(19BIT13)
Madurai – 625002
THE AMERICAN COLLEGE
Madurai - 625002.
DEPARTMENT OF INFORMATION
TECHNOLOGY
BONAFIDE CERTIFICATE
This is to certify that the project work entitled as “IMAGE EDITOR” Submitted by
K. DEEPIKA (19BIT13) in partial fulfillment of requirements for the award of the
Degree of Bachelor of Information Technology, The American College, Madurai,
is a bonafide record of the work by her during the year 2019 – 2022.
Mr.J.S. John Gladson Prabhu MCA.,M.Phil., Dr.N. Ravia Shabnam Parveen MCA., M.E.,Ph.D.,
Internal Examiner
DECLARATION
I hereby declare that this project was carried out by me under the
guidance of Mr. J. S. JOHN GLADSON PRABHU MCA., M.Phil.,
Department of Information Technology, The American College,
Madurai. I also declare that this project report is the result of my own
effort and that is that has not been copied from anyone and has not been
submitted by anybody in any other Universities / Institution/ Research
Centers.
Also I would like to thank all my teachers , my parents, friends and all my well-
wishers who have helped me during the completion of this project.
S.NO CONTENT PAGE NO
1 INTRODUCTION
1.1 Overview of Project 1
2 SYSTEM ANALYSIS
2.1 ABSTRACT 2
3 SYSTEN REQUIREMENT
3.1 Hardware Requirement 4
3.2 Software Requirement
4 SOFTWARE DESCRIPTION
4.1 Features of Python 5
4.2 Features of Pygame
5 SYSTEM DESIGN
5.1 Data Flow Diagram 7
6 SYSTEM DESCRIPTION
6.1 Modules Description 15
7 CODING 20
8 TESTING 31
9 SCREENSHOT 34
10 CONCLUSION 44
11 FUTURE ENHANCEMENT 46
12 BIBLIOGRAPHY 48
INTRODUCTION
1.INTRODUCTION
1
SYSTEM ANALYSIS
2
2. SYSTEM ANALYSIS
This project is about turning an image into a pencil sketch, Water Color,
Oil painting , Cartoon and color sketch and black and white. An Image
can be Selected using the Select Button and also exit that page using the
Exit Button. There are many features are used to process the image like
increase the level of brightness, level of contrast, Rotate the image to
different sizes, Increasing the image border
Existing System:
In Existing System there are many types to transform a Normal
Image into a gorgeous Image and we can Choose Our Image and
Change it to a Beautiful Image and save it.
Proposed System:
Every day there are more and more Technology-related
3
SYSTEM REQUIREMENT
4
3. SYSTEM REQUIREMENT
Ram : 2 GB
5
3.2. SOFTWARE SPECIFICATION
6
SOFTWARE DESCRIPTION
7
4. SOFTWARE DESCRIPTION
4.1 Python
It was created by Guido van Rossum during 1985- 1990. Open CV is a Python
library that is used to work with Computer Vision and other artificial artifacts. Open
CV has inbuilt functions and methods which provide access to work with Computer
Vision in Artificial Intelligence and Machine Learning.
Python is Interactive − You can actually sit at a Python prompt and interact with the
interpreter directly to write your programs.
8
Python is Object-Oriented − Python supports Object-Oriented style or technique of
programming that encapsulates code within objects.
games.
Characteristics of Python
• It provides very high-level dynamic data types and supports dynamic type
checking.
• It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.
9
Easy-to-read − Python code is more clearly defined and visible to the eyes.
A broad standard library − Python's bulk of the library is very portable and cross-
platform compatible on UNIX, Windows, and Macintosh.
Interactive Mode − Python has support for an interactive mode which allows
interactive testing and debugging of snippets of code.
Portable − Python can run on a wide variety of hardware platforms and has the same
interface on all platforms.
Extendable − You can add low-level modules to the Python interpreter. These
modules enable programmers to add to or customize their tools to be more efficient.
Programming − Python supports GUI applications that can be created and ported to
many system calls, libraries and windows systems, such as Windows MFC,
Macintosh, and the X Window system of Unix.
Scalable − Python provides a better structure and support for large programs than
shell scripting.
Apart from the above-mentioned features, Python has a big list of good features, few
are listed below −
• It provides very high-level dynamic data types and supports dynamic type
checking.
• It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.
10
Advantages/Benefits of Python
Python provides a large standard library which includes areas like internet
protocols, string operations, web services tools and operating system
interfaces. Many high use programming tasks have already been scripted into
the standard library which reduces length of code to be written significantly.
Further, its development is driven by the community which collaborates for its code
through hosting conferences and mailing lists, and provides for its numerous
modules.
11
5. User-friendly Data Structures:
Python has built-in list and dictionary data structures which can be used to construct
fast runtime data structures. Further, Python also provides the option of dynamic
high-level data typing which reduces the length of support code that is needed.
Python
becomes an excellent option for anyone not willing to invest too much in
development costs. And, Python has fascinating real world applications .
Apply filters: We can go for a variety of filters using the same techniques which can
be very helpful from an artificial intelligence market’s view most specifically for
VR/AR companies.
12
Modifying images: Nowadays many applications are developed in the market which
give a pricky effect to the pictures and this filtering kind of image processing can
surely contribute to those applications.
To make sure that in each type of the image our results should be same for that, it is
always a good practice to use resize function so our kernel operations are done
effectively.
Python Imaging Library for some very simple image manipulation, however I'm
having trouble converting a greyscale image to a monochrome (black and white)
image. If I save after changing the image to greyscale (convert('L')) then the image
renders as you would expect.
Image cartoon frames don’t contain so many variants of color and those frames also
contain dark edges of each object. There’re lots of ways to do that, but we’re going
to use color quantization and the adaptive threshold technique. Using this technique
we can achieve a very great result.
OpenCV
OpenCV is a python library for image processing. It is an open- source library that
can be used in real-time computer vision applications. In this project, we will use
opencv to create image cartoons.
13
GUI Programming − Python supports GUI applications that can be created and
ported to many system calls, libraries and windows systems, such as Windows MFC,
Macintosh, and the X Window system of Unix. • Scalable − Python provides
scripting.
• Easy-to-learn − Python has few keywords, simple structure, and a clearly defined
syntax. This allows the student to pick up the language
Color Quantization
14
SYSTEM DESIGN
15
5. SYSTEM DESIGN
A data flow diagram (DFD) maps out the flow of information for any process or
system. It uses defined symbols like rectangles, circles and arrows, plus short text
labels, to show data inputs, outputs, storage points and the routes between each
destination. Data flowcharts can range from simple, even hand-drawn process
overviews, to in-depth, multi-level DFDs that dig progressively deeper into how the
data is handled.
SYMBOLS
External Entity
Process
Data Store
Data Flow
16
IMAGE
EDITOR
Select
Apply any
features
Save
Exit
image
17
6 . SYSTEM DESCRIPTION
6.1. MODULES DESCRIPTION:
1. Editor page
Select Image
3. Image Types
Pencilsketch ,Watercolor
Editor page:
Image Editor.
Select :
Save Button is used to Save the processed image and Exit that page using
the Exit Button.
18
Image Types :
Image Editor have some Image types to process the Input Image.
There are Pencil sketch ,Watercolor, Oil Painting, Black and White, color sketch,
Cartoon.
Pencil sketch :
Water Color :
Oil Painting :
An oil painting is used to decrease image dynamic and hence increase oil
painting effect.
Color Sketch :
In this section colorimage convert to the black and white image through
the cv2.pencilsketch method.
Cartoon :
19
CODING
20
7. CODING
destinationimg = ImageTk.PhotoImage(sourceimg)
21
sourcecanvas.create_image(300, 210, image=destinationimg)
sourcecanvas.image=destinationimg
except Exception as ex:
messagebox.showinfo("Exception","Excption occurred and error mssage is:"" "+
str(ex) +" """)
22
try:
if not os.path.isfile(destinationImg_Path) :
messagebox.showinfo("Alert", "Please select image!!!")
sys.exit()
else:
for m in range(0, v2.get()+1):
sourceimage = Image.open(destinationImg_Path)
sourceimage.thumbnail((350, 350))
scaleimg = ImageEnhancee.Brightness(sourceimage)
brighttempimg = scaleimg.enhance(m)
brightimage = ImageTk.PhotoImage(brighttempimg)
destinationcanvas.create_image(300, 210, image=brightimage)
destinationcanvas.image=brightimage
except Exception as ex:
messagebox.showinfo("Exception","Excption occurred and error
mssage is:"" "+ str(ex) +" """)
sys.exit()
# function is used to modify the image contrast
def contrast(event):
global contrasttempimg, contrastimg
try:
if not os.path.isfile(destinationImg_Path) :
messagebox.showinfo("Alert", "Please select image!!!")
sys.exit()
else:
for m in range(0, v3.get()+1):
23
scaleimg = ImageEnhance.Contrast(sourceimage)
contrasttempimg = scaleimg.enhance(m)
contrastimg = ImageTk.PhotoImage(contrasttempimg)
destinationcanvas.create_image(300, 210, image=contrastimg)
destinationcanvas.image=contrastimg
except Exception as ex:
messagebox.showinfo("Exception","Excption occurred and error
mssage is:"" "+ str(ex) +" """)
sys.exit()
24
except Exception as ex:
messagebox.showinfo("Exception","Excption occurred and error
mssage is:"" "+ str(ex) +" """)
# function is used to add the image border
def image_border(event):
global bordertempimg, borderimg
try:
if not os.path.isfile(destinationImg_Path) :
messagebox.showinfo("Alert", "Please select image!!!")
else:
sourceimage = Image.open(destinationImg_Path)
sourceimage.thumbnail((350, 350))
bordertempimg = ImageOps.expand(sourceimage,
border=int(border_combo.get()), fill=95)
borderimg = ImageTk.PhotoImage(bordertempimg)
destinationcanvas.create_image(300, 210, image=borderimg)
destinationcanvas.image=borderimg
except Exception as ex:
messagebox.showinfo("Exception","Excption occurred and error
mssage is:"" "+ str(ex) +" """)
25
invblur_img=cv2.bitwise_not(blur_img)
destinationimg=cv2.divide(grey_img,invblur_img,
scale=256.0)
if imgType_combo.get() == "Water Color":
destinationimg = cv2.stylization(cvimg, sigma_s=100,
sigma_r=0.45)
if imgType_combo.get() == "Oil Painting":
destinationimg = cv2.xphoto.oilPainting(cvimg, 7, 1)
if imgType_combo.get() == "Cartoon":
gray = cv2.cvtColor(cvimg, cv2.COLOR_BGR2GRAY)
26
if imgType_combo.get() == "Black and White":
destinationimg,colorimg = cv2.pencilSketch(cvimg,
sigma_s=10, sigma_r=0.40, shade_factor=0.02)
cv2.imwrite(destinationImg_Path, destinationimg)
cv2.waitKey(0)
cv2.destroyAllWindows()
# function is used to save the image
def save():
global img_path, blurtempimg, blurfinalimg, brighttempimg,
brightimage, contrasttempimg, contrastimg, rotatetempimg, rotateimg,
bordertempimg, borderimg,destinationimg
try:
ext = img_path.split(".")[-1]
file=asksaveasfilename(defaultextension
=f".{ext}",filetypes=[("All Files","."),("PNG file",".png"),("jpg
file",".jpg")])
27
# create brightness control design
imageBrightness = Label(master, text="Brightness:", font=("ariel 17
bold"),bg="lightblue")
imageBrightness.place(x=8, y=50)
v2 = IntVar()
scaleBrightness = ttk.Scale(master, from_=0, to=10, variable=v2,
orient=HORIZONTAL, command=brightness)
scaleBrightness.place(x=150, y=55)
28
# create border control design
border = Label(master, text=" Border:", font=("ariel 17 bold"),bg="lightblue")
border.place(x=360, y=50)
values2 = [i for i in range(0, 55, 5)]
border_combo = ttk.Combobox(master, values=values2, font=("ariel 10 bold"))
border_combo.place(x=460, y=50)
border_combo.bind("<<ComboboxSelected>>", image_border)
29
# create buttons
btnSelectImage = Button(master, text="Select Image", bg='black', fg='gold',
font=('ariel 15 bold'), relief=GROOVE, command=selected)
btnSelectImage.place(x=100, y=595)
btnSaveImage = Button(master, text="Save", width=12, bg='black', fg='gold',
font=('ariel 15 bold'), relief=GROOVE, command=save)
btnSaveImage.place(x=280, y=595)
btnExit = Button(master, text="Exit", width=12, bg='black', fg='gold', font=('ariel 15
bold'), relief=GROOVE, command=master.destroy)
btnExit.place(x=460, y=595)
master.mainloop()
30
TESTING
31
8. TESTING
8.1. UNIT TESTING:
Unit testing involves the design of test cases that validate that the internal program
logic is functioning properly, and that program inputs produce valid outputs. All
decision branches and internal code flow should be validated. It is the testing of
individual software units of the application it is done after the completion of an
individual unit before integration. This is a Structural Testing that relies on
knowledge of its Construction and is invasive. Unit tests perform basic tests at
Component level and test a specific business process, application, and /or system
Configuration. Unit tests ensure that each unique path of a business process performs
accurately to the documented specifications and contains clearly defined inputs and
expected results.
32
Testing is the set of activities that can be planned in advance and conduct
systematically. There are many ways of testing the system’s reliability, completeness
and maintainability.
Functional testing ensures that the requirements are properly satisfied by the
application System. The functions are those tasks that the system is design to
accomplish. This is not concerned with how processing occurs but rather with the
results of the process functional analysis based test sets tend to uncover errors that
occurred in implementing requirements or design specifications
33
SCREENSHOTS
34
9. SCREENSHOT
IMAGE EDITOR
Image Edior Starting window
SELECT IMAGE
35
Save Button :
36
BLUR IMAGE
BRIGHTNESS
37
CONTRAST
BORDER
38
ROTATE
39
PENCIL SKETCH
WATER COLOR
40
OIL PAINTING
CARTOON
41
COLOR SKETCH
42
FINAL PAGE
43
CONCLUSION
44
10. CONCLUSION
User can Edit Image to Attractively through this Image Editor. When We Change
Our Pictures in different categories like this. It gives us some good feel. It will be
very useful in future as the youth of today are interested in changing their picture and
posting on Social Media.
45
FUTURE ENHANCEMENT
46
11. FUTURE ENHANCEMENT
In future can Combine extremely different types and even the man’s face can be
changed exactly as you want. Already many Amazing features . Already Many
Amazing features are keep coming into the Technology.
47
BIBLIOGRAPHY
48
12. BIBLIOGRAPHY
WEB REFERENCE :
Tkinter:
❖ www.w3schools.com
❖ www.tutorialspoint.com
Python:
❖ www.w3schools.com
❖ www.tutorialspoint.com
❖ www.analyticsvidhya.com
❖ www.delftsack.com
49
50