A System For Cartoonifying An Image Using Python: January 2023
A System For Cartoonifying An Image Using Python: January 2023
net/publication/367475637
CITATIONS READS
14 2,520
5 authors, including:
All content following this page was uploaded by Pankaj Chandra on 03 July 2023.
Vaibhav Kant Singh1, Santosh Kumar Soni2 , Dr. Nageshwar Dev Yadav3, Pankaj Chandra4
Assistant Professor, Department of Computer Science & Engineering, School of Studies of
Engineering and Technology, Guru Ghasidas Vishwavidyalaya, Central University, Bilaspur,
Chhattisgarh, India1, Assistant Professor, Department of Information Technology, School of Studies
of Engineering and Technology, Guru Ghasidas Vishwavidyalaya, Central University, Bilaspur,
Chhattisgarh, India2, R & D Product Specialist at Informatica Bangalore3, Assistant Professor,
Department of Information Technology, School of Studies of Engineering and Technology, Guru
Ghasidas Vishwavidyalaya, Central University, Bilaspur, Chhattisgarh, India 4
[email protected], [email protected], [email protected],
[email protected]
ORCID ID: 0000-0002-6776-9573
ABSTRACT
Cartoonization is itself a classic art but, the advancement in the field of Machine Learning is covering
almost every domain. Cartoon-style pictures can be seen almost everywhere in our daily life.
Technology is the mode by which users can store, fetch, communicate and utilize information. Image
processing plays a significant role in all computer-related applications, mainly while processing and
experimenting on images using image processing libraries.
With the recent success of Instagram, the popularity of simple and fun photo effects apps has been on
the rise. The mobile platform presents a unique arena for these applications by connecting users with
both the means to capture images and the computational power to perform sophisticated processing
on these images. Cartooning images seeks to leverage the existing OpenCV library
This work presents an approach to cartoonize digital images into cartoon-like. The method used is
different from what others used previously. This work focuses mainly on various techniques involved
during the whole process, which, when used layer by layer, gives an appropriately balanced output.
We also discuss the algorithms used in the process to make the image cartoonized.
KEYWORD:- ML, CARTOONIZED, PYTHON, OpenCV
INTRODUCTION
Cartoons are illustrations of characters that can be imaginary or based on a personality. They are
semi-realistic or non-realistic, popular nowadays to depict a situation or a happening in a funny,
satirical manner. Animes are so popular that are cartoonized characters. Automation technology is
booming nowadays. Human effort reduced to the minimum; with a set of programs doing our job,
animation technology has taken a considerable leap. Our job is to make those programs. So, this is a
project which converts regular camera clicked images into cartoonized form, created using Python
language and relative libraries. In times like today, where technology is taking huge leaps with
creative minds improving them day by day. Anime movies take much longer than regular movies in
times of VFX effects and animations. The workforce, skillset, and resources in terms of equipment
Volume No. 14, Issue- 5 , October - December 2022 84
and investment are more than classic movies, so time plays an essential role in creating these movies.
For saving time, automation is the best way to go; with improvement in machine learning and artificial
intelligence, every production process has improved significantly and improved the quality of the
product.Playing with images is a fun activity, and recently, image processing has outburst social sites,
with many people making careers in image processing and enhancement. The OpenCV library works
on the same thing, and here we get to know the backend procedures of image processing and
understand how computer vision works. These filters and techniques improve lost details on older
photos, and with a combination of some filters, one of them is converting an black and white image
to a colored one.There are numerous ways to convert a specific photo to a cartoonized one, but the
best way is to do a manual with software like Adobe Photoshop, and not everyone has their hands on
tools like these, so the users there are limited. Although the output we obtain from the manual process
is the best, it is time-consuming, and doing it for many images is not efficient. Therefore, systems
like these are a go-go for every field as it provides output in seconds with upgrades, the scale will
surely improve with even better results.We can do it with a limited number of lines of code in a
programming language with better results using OpenCV library and machine learning algorithms in
python.To achieve the basic cartoon effect, we don't need powerful rendering software or even years
of experience. All we need is essentially a bilateral filter and some edge detection. The bilateral filter
will reduce the color palette, which is essential for the cartoon look, and edge detection will allow
you to produce bold silhouettes.
PROBLEM STATEMENT
In the current time social media has encompassed around the whole globe. In the globe it is being
used by almost all age groups. You can think of the amount the social media is utilized. It is used for
several purposes. There is an issue that is to be addressed in the utilization of the social media i.e.,
Security. The authors of the report tried to find out a Way in which we can incorporate security.In
recent times usage of applications that includes converting images into different forms and styles is
getting craze all over the globe. Here comes the issue. We can’t trust some sites as they might steal
our information like mainly images and may use them in a bad way that affect them. We can simply
do this with some lines of codes using OpenCV. The authors made an implementation in python
language that is very user friendly to address the problem. The security issue is a serious issue as it
may cause catastrophic results. So, looking to the need the authors went to the development which is
presented in this report
LITERATURE SURVEY
AUTHORS AND
S.NO TITLE OF PAPER PUBLICATIONS SUMMARY
DETAILS
Institute of Deep
Learning, Baidu
Tsinghua University
Deep Challenges Associated In this paper, various work has
with Deep been discussed related to hidden
layers, network structure,
activation functions, loss
functions, model optimization,
epochs and batch size. These
areas bring challenge to deep
7 Ochin Sharma
learning field not only in
Learning
theoretical designing but while
implementing the model
experimentally. So, researchers
may find these to work with and
provide efficient solutions for
these.
In this paper, we talk about
structure of CNN and all the
models of CNN which are
proposed till date.
Convolutional Neural Network
has proved to be an important
tool in Machine Learning field.
Diving deep in Deep Divya Arora Mehak Although there still lies open
8
Convolutional Neural Network Garg Megha Gupta issues like reducing the
parameters of Fully Connected
layer and reducing the error rate
when the network is exposed to
dense data. It has proved that
adding more layers improve the
performance but also increase
the parameters with each layer.
PROPOSED WORK
• we do that
using
Create edge cvtcolor,medi
anblur and
mask adaptive
threshold
functions.
• using certian
algorithms,
we reduce the
Color colors in the
Quantization image to
make it look
like a cartoon
image. • we use
bilateral
filter and
Reduce the operation. It
gives a bit
Fig-1:-The process happens in the color palatte form of a flowchart.
blurred and
sharpness
Methodology: reducing
effect.
The process to create a cartoon effect image can • using bitwise be
operator we
initially branched into 2 Divisions Combine edge combine the
mask with two images to
1. To detect, blur and bold the edges of the colored image . get the actual
cartoonized
RGB color image. effect.
2. To smooth, quantize and the conversion of the RGB image to grayscale. The results involved
in combining the image and help achieve the desired result.
Steps involved are:
1. We load the image that is to be converted.
2. We go through the edge operations to get the effects of a cartoon i.e., to get thicker edges
around the object (person, thing, etc.) in the image.
3. Then, we reduce the color palette using OpenCV optimized algorithms like Kmeans algorithm
in this step.
4. After doing color quantization, we can reduce the noise of the image using bilateral filter. It
would give a bit blurry and sharpness reducing effect to the image.
Volume No. 14, Issue- 5 , October - December 2022 95
5. The last step is we combine the edge mask with the color processed image. We do that using
the bitwise operation.
RESULT
From the samples some of the results we got, are displayed below.
30. V.K. Singh, “SVM using rbf as kernel for Diagnosis of Breast Cancer,” International
Conference on Innovative Research in Science, Management and Technology (ICIRSMT 2021),
Department of Computer Science and Application, Atal Bihari Vajpayee University, Bilaspur (C.G.),
India in association with American Institute of Management and Technology (AIMT), USA,
December 27-28 2021.
31. V.K. Singh, “Support Vector Machine using rbf, polynomial, linear and sigmoid as kernel to
detect Diabetes Cases and to make a Comparative Analysis of the Models,” International Conference
on Innovative Research in Science, Management and Technology (ICIRSMT 2021), Department of
Computer Science and Application, Atal Bihari Vajpayee University, Bilaspur (C.G.), India in
association with American Institute of Management and Technology (AIMT), USA, December 27-
28 2021.
32. V.K. Singh, “Colorization of old gray scale images and videos using deep learning,” Published
in The Journal of Oriental Research Madras, ISSN: 0022-3301, 2021.
33. V.K. Singh, “Dual Secured Data Transmission using Armstrong Number and Color Coding,”
Prestige e-Journal of Management and Research, Volume 3, Issue 1, ISSN: 2350-1316, April 2016.
34. V.K. Singh, A. Baghel and S.K. Negi, “Finding New Framework for Resolving Problems in
Various Dimensions by the use of ES: An Efficient and Effective Computer Oriented Artificial
Intelligence Approach,” Volume 4, No. 11, ISSN(Paper): 2222-1727, ISSN(Online): 2222-2871,
2013.
35. Chandrashekhar, R. Chauhan and V.K. Singh,” Twitter Sentiment Analysis,” ISPEC 8TH
INTERNATIONAL CONFERENCE ON AGRICULTURAL, ANIMAL SCIENCE AND RURAL
DEVELOPMENT, BINGOL, TURKEY, DECEMBER 24-25, 2021.
36. P. Kumari, R. Gupta, S. Kumar and V.K. Singh,” ML Approach for Detection of Lung
Cancer,” ISPEC 8TH INTERNATIONAL CONFERENCE ON AGRICULTURAL, ANIMAL
SCIENCE AND RURAL DEVELOPMENT, BINGOL, TURKEY, DECEMBER 24-25, 2021.
37. P. Sailokesh, S. Jupudi, I.K. Vamsi and V.K. Singh,” Automatic Number Plate Recognition,”
ISPEC 8TH INTERNATIONAL CONFERENCE ON AGRICULTURAL, ANIMAL SCIENCE
AND RURAL DEVELOPMENT, BINGOL, TURKEY, DECEMBER 24-25, 2021.
38. Y.K. Reddy, K.M. Yadav and V.K. Singh,” Human Activity Recognition,” ISPEC 8TH
INTERNATIONAL CONFERENCE ON AGRICULTURAL, ANIMAL SCIENCE AND RURAL
DEVELOPMENT, BINGOL, TURKEY, DECEMBER 24-25, 2021.
39. R.N.R.K. Prasad, P.S.S.R Ram, S. Dinesh and V.K. Singh,” Text Summarization,” ISPEC
8TH INTERNATIONAL CONFERENCE ON AGRICULTURAL, ANIMAL SCIENCE AND
RURAL DEVELOPMENT, BINGOL, TURKEY, DECEMBER 24-25, 2021.
40. V.K. Singh, N.D. Yadav and R.K. Singh,” Diagnosis of Breast Cancer using SVM taking
polynomial as Kernel,” Design Engineering (Toronto), Volume 2021, Issue-08, pp. 6589-6599, ISSN:
0011-9342, 2021.