SlideShare ist ein Scribd-Unternehmen logo
How To Make A Speech Bubble
                                     By: Sweta Vajjhala

        There can be many different applications of picture-manipulation in JES. One of the best
applications is making a comic strip. In these comic strips, there are often characters that say
things. To indicate that a character is speaking, a speech bubble is often used. JES can be used to
make speech bubbles for these characters. This tutorial is a step-by-step tutorial that will show an
example of how to make a speech bubble.

       Our desired result is as follows:




Assuming that all of this should be done inside of one function, then there are three main steps
required in order to obtain the above result:

1) Make the canvas
2) Make & copy the character onto the canvas
3) Make the speech bubble & add it to the canvas.
Making The Canvas

First, we have to define a function: let’s call it makeSpeechBubble. Also, be sure to set your
media path to the place where your character and canvas are located. We will also assume that
we are making a picture from a pre-existing canvas, which has a size of
640x480 pixels. Once we add the canvas, we want the entire background to be white. So far, this
is what our code looks like:

def makeSpeechBubble():
 canvas = makePicture(getMediaPath("640x480.jpg"))
 canvas.addRectFilled(white,1,1,640,480)



Making And Copying The Character Onto The Canvas

After making the canvas, the next step is to copy a character onto the canvas. In order to do this,
first, we have to make the picture, which is similar to making the canvas.

caterpillar = makePicture(getMediaPath("caterpillar.jpg"))

The easiest way to copy the caterpillar onto the canvas is using two for loops. For each pixel
(x,y), we will copy it onto the canvas at location (targetX,targetY), where the first value for
targetX and targetY will start at the value where the top-left corner of the image should appear.

 targetX = 300
 for x in range(1,getWidth(caterpillar)):
  targetY = 20
  for y in range(1,getHeight(caterpillar)):
    c1 = getColor(getPixel(caterpillar,x,y))
    setColor(getPixel(canvas,targetX,targetY),c1)
    targetY = targetY + 1
  targetX = targetX + 1

This means that we will copy the caterpillar onto the canvas, and the top-left corner of the
caterpillar will appear at (300,20) on the canvas.

Making and Adding The Speech Bubble Onto The Canvas

Now that we have a character that is copied onto the canvas, we have to make a speech bubble
for the character. In order to make the bubble and add it to the canvas at the same time, there is a
built-in JESS function called addOval. This function takes in five parameters (in the following
order): color, startingX, startingY, width, height. This will give you an oval

       canvas.addOval(black,235,5,95,45)

Now that we have our actual speech bubble, we need to put the speech inside of it! Just like there
is an addOval function, JES also has a built-in addText function. The parameters for the addText
function are: color, startingX, startingY, “text”. It is best to specify the startingX and the
startingY somewhere inside the bubble. For example, the speech bubble itself starts at (235,5), so
starting the text at (235,5) would not be a good idea. Instead, starting the text at (255,22) ensures
that the entire text will appear inside the speech bubble. Since I was “CS1315!” to appear in a
new line, I will start that text at (260,28). This will give the appearance that “CS1315!” is
centered under “Hello! I love”.

       canvas.addText(blue,255,20,“Hello! I love”)
       canvas.addText(blue,260,38,“CS1315!”)



After all of this is done, it is important to remember to return the canvas. If you want to save the
final result, you can put in a writePictureTo statement, which will write the canvas to a file.
However, if you want it to be executed, it must be placed before the return statement.

       writePictureTo(canvas,“C:SwetaGeorgia TechCS 1315 TAcaterpillar.jpg”)
       return canvas

When you run this program, it should be run as follows:

>>> setMediaPath()
New media folder: C:Program FilesJESMediaSources
>>> show(makeSpeechBubble())

After running this, the final result should be the picture above!

Weitere ähnliche Inhalte

Was ist angesagt?

Adventure progress log
Adventure progress log Adventure progress log
Adventure progress log
matthewturley1
 
Photograph Analysis
Photograph AnalysisPhotograph Analysis
Photograph Analysis
07wilsk
 
Poster making
Poster makingPoster making
Poster making
anilamushtaq67
 
Image manipulation 2
Image manipulation 2Image manipulation 2
Image manipulation 2
clairemedia1
 
Magazine Advert Production
Magazine Advert ProductionMagazine Advert Production
Magazine Advert Production
Natt Suchecki
 
Triangular process chart 3 stages powerpoint templates 0712
Triangular process chart 3 stages powerpoint templates 0712Triangular process chart 3 stages powerpoint templates 0712
Triangular process chart 3 stages powerpoint templates 0712
SlideTeam.net
 
Build 2016 - P492 - The Power of the EffectBrush in Windows UI
Build 2016 - P492 - The Power of the EffectBrush in Windows UIBuild 2016 - P492 - The Power of the EffectBrush in Windows UI
Build 2016 - P492 - The Power of the EffectBrush in Windows UI
Windows Developer
 
Portfolio
PortfolioPortfolio
Portfolio
Logan Armstrong
 
Production ident Jerome
Production ident JeromeProduction ident Jerome
Production ident Jerome
MynameisPoseidon
 
Creating our logo
Creating our logoCreating our logo
Creating our logo
zoya167
 
Construction for 'Eye Blink' Effect
Construction for 'Eye Blink' EffectConstruction for 'Eye Blink' Effect
Construction for 'Eye Blink' Effect
eaglej09
 
Filipova Portfolio
Filipova PortfolioFilipova Portfolio
Filipova Portfolio
Tereza Filipova
 
Photoshop Screenshots
Photoshop ScreenshotsPhotoshop Screenshots
Photoshop Screenshots
KB160923
 

Was ist angesagt? (13)

Adventure progress log
Adventure progress log Adventure progress log
Adventure progress log
 
Photograph Analysis
Photograph AnalysisPhotograph Analysis
Photograph Analysis
 
Poster making
Poster makingPoster making
Poster making
 
Image manipulation 2
Image manipulation 2Image manipulation 2
Image manipulation 2
 
Magazine Advert Production
Magazine Advert ProductionMagazine Advert Production
Magazine Advert Production
 
Triangular process chart 3 stages powerpoint templates 0712
Triangular process chart 3 stages powerpoint templates 0712Triangular process chart 3 stages powerpoint templates 0712
Triangular process chart 3 stages powerpoint templates 0712
 
Build 2016 - P492 - The Power of the EffectBrush in Windows UI
Build 2016 - P492 - The Power of the EffectBrush in Windows UIBuild 2016 - P492 - The Power of the EffectBrush in Windows UI
Build 2016 - P492 - The Power of the EffectBrush in Windows UI
 
Portfolio
PortfolioPortfolio
Portfolio
 
Production ident Jerome
Production ident JeromeProduction ident Jerome
Production ident Jerome
 
Creating our logo
Creating our logoCreating our logo
Creating our logo
 
Construction for 'Eye Blink' Effect
Construction for 'Eye Blink' EffectConstruction for 'Eye Blink' Effect
Construction for 'Eye Blink' Effect
 
Filipova Portfolio
Filipova PortfolioFilipova Portfolio
Filipova Portfolio
 
Photoshop Screenshots
Photoshop ScreenshotsPhotoshop Screenshots
Photoshop Screenshots
 

Andere mochten auch

Overview Azure
Overview AzureOverview Azure
Overview Azure
Fabian Gehrke
 
Continuous Delivery for Mobile
Continuous Delivery for MobileContinuous Delivery for Mobile
Continuous Delivery for Mobile
Sweta Vajjhala
 
MS Techday Botucatu - SharePoint for Internet Sites
MS Techday Botucatu - SharePoint for Internet SitesMS Techday Botucatu - SharePoint for Internet Sites
MS Techday Botucatu - SharePoint for Internet Sites
Fabian Gehrke
 
Enterprise Java Hosting in a Cloud Environment
Enterprise Java Hosting in a Cloud EnvironmentEnterprise Java Hosting in a Cloud Environment
Enterprise Java Hosting in a Cloud Environment
Sweta Vajjhala
 
BluDotNet - Introdução ao SharePoint 2010
BluDotNet - Introdução ao SharePoint 2010BluDotNet - Introdução ao SharePoint 2010
BluDotNet - Introdução ao SharePoint 2010
Fabian Gehrke
 
today
todaytoday
ECO Developers - Piracicaba 2010 - SharePoint 2010 - Colaborando com o Planeta
ECO Developers - Piracicaba 2010 - SharePoint 2010 - Colaborando com o PlanetaECO Developers - Piracicaba 2010 - SharePoint 2010 - Colaborando com o Planeta
ECO Developers - Piracicaba 2010 - SharePoint 2010 - Colaborando com o Planeta
Fabian Gehrke
 

Andere mochten auch (7)

Overview Azure
Overview AzureOverview Azure
Overview Azure
 
Continuous Delivery for Mobile
Continuous Delivery for MobileContinuous Delivery for Mobile
Continuous Delivery for Mobile
 
MS Techday Botucatu - SharePoint for Internet Sites
MS Techday Botucatu - SharePoint for Internet SitesMS Techday Botucatu - SharePoint for Internet Sites
MS Techday Botucatu - SharePoint for Internet Sites
 
Enterprise Java Hosting in a Cloud Environment
Enterprise Java Hosting in a Cloud EnvironmentEnterprise Java Hosting in a Cloud Environment
Enterprise Java Hosting in a Cloud Environment
 
BluDotNet - Introdução ao SharePoint 2010
BluDotNet - Introdução ao SharePoint 2010BluDotNet - Introdução ao SharePoint 2010
BluDotNet - Introdução ao SharePoint 2010
 
today
todaytoday
today
 
ECO Developers - Piracicaba 2010 - SharePoint 2010 - Colaborando com o Planeta
ECO Developers - Piracicaba 2010 - SharePoint 2010 - Colaborando com o PlanetaECO Developers - Piracicaba 2010 - SharePoint 2010 - Colaborando com o Planeta
ECO Developers - Piracicaba 2010 - SharePoint 2010 - Colaborando com o Planeta
 

Ähnlich wie Creating Speech Bubbles in Jython

Lesson two presentation
Lesson two presentationLesson two presentation
Lesson two presentation
sutt202
 
Liquid column layout final
Liquid column layout finalLiquid column layout final
Liquid column layout final
Justin Macri
 
Shadows Effects in CSS
Shadows Effects in CSSShadows Effects in CSS
Shadows Effects in CSS
Webtech Learning
 
Introduction to Processing
Introduction to ProcessingIntroduction to Processing
Introduction to Processing
Green Moon Solutions
 
Skills development
Skills developmentSkills development
Skills development
JitsuLeon
 
Interactive Mouse (Report On Processing)
Interactive Mouse (Report On Processing)Interactive Mouse (Report On Processing)
Interactive Mouse (Report On Processing)
TongXu520
 
2.2 Production Experiments.pptx
2.2 Production Experiments.pptx2.2 Production Experiments.pptx
2.2 Production Experiments.pptx
DanRichardson47
 
PowerPoint Ideas & Hacks: Quotes
PowerPoint Ideas & Hacks: QuotesPowerPoint Ideas & Hacks: Quotes
PowerPoint Ideas & Hacks: Quotes
Ashleigh Cote, CMP
 
2.2 Production Experiment 1.pptx
2.2 Production Experiment 1.pptx2.2 Production Experiment 1.pptx
2.2 Production Experiment 1.pptx
DanRichardson44
 
Creating and adding titles
Creating and adding titlesCreating and adding titles
Creating and adding titles
chloechorlton
 
Process of animating company ident “Planetary Quarantine”
Process of animating company ident “Planetary Quarantine”Process of animating company ident “Planetary Quarantine”
Process of animating company ident “Planetary Quarantine”
MarianD
 
Processing Workshop Slides for Ladies Learning Code - March 22, 2014
Processing Workshop Slides for Ladies Learning Code - March 22, 2014Processing Workshop Slides for Ladies Learning Code - March 22, 2014
Processing Workshop Slides for Ladies Learning Code - March 22, 2014
Stephen Boyd
 
Getting Visual with Ruby Processing
Getting Visual with Ruby ProcessingGetting Visual with Ruby Processing
Getting Visual with Ruby Processing
Richard LeBer
 
Constructing my music magazine
Constructing my music magazineConstructing my music magazine
Constructing my music magazine
GBarco20
 
Learn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing LanguageLearn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing Language
shelfrog
 
Learn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing LanguageLearn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing Language
W M Harris
 
Photoshop text - My Experimentation
Photoshop text - My ExperimentationPhotoshop text - My Experimentation
Photoshop text - My Experimentation
tafi94
 
1. production experiments
1. production experiments1. production experiments
1. production experiments
HarrietSmith35
 
Photoshop textt
Photoshop texttPhotoshop textt
Photoshop textt
tafi94
 
Animate The Web With Ember.js - Jessica Jordan
Animate The Web With Ember.js - Jessica JordanAnimate The Web With Ember.js - Jessica Jordan
Animate The Web With Ember.js - Jessica Jordan
Jessica Jordan
 

Ähnlich wie Creating Speech Bubbles in Jython (20)

Lesson two presentation
Lesson two presentationLesson two presentation
Lesson two presentation
 
Liquid column layout final
Liquid column layout finalLiquid column layout final
Liquid column layout final
 
Shadows Effects in CSS
Shadows Effects in CSSShadows Effects in CSS
Shadows Effects in CSS
 
Introduction to Processing
Introduction to ProcessingIntroduction to Processing
Introduction to Processing
 
Skills development
Skills developmentSkills development
Skills development
 
Interactive Mouse (Report On Processing)
Interactive Mouse (Report On Processing)Interactive Mouse (Report On Processing)
Interactive Mouse (Report On Processing)
 
2.2 Production Experiments.pptx
2.2 Production Experiments.pptx2.2 Production Experiments.pptx
2.2 Production Experiments.pptx
 
PowerPoint Ideas & Hacks: Quotes
PowerPoint Ideas & Hacks: QuotesPowerPoint Ideas & Hacks: Quotes
PowerPoint Ideas & Hacks: Quotes
 
2.2 Production Experiment 1.pptx
2.2 Production Experiment 1.pptx2.2 Production Experiment 1.pptx
2.2 Production Experiment 1.pptx
 
Creating and adding titles
Creating and adding titlesCreating and adding titles
Creating and adding titles
 
Process of animating company ident “Planetary Quarantine”
Process of animating company ident “Planetary Quarantine”Process of animating company ident “Planetary Quarantine”
Process of animating company ident “Planetary Quarantine”
 
Processing Workshop Slides for Ladies Learning Code - March 22, 2014
Processing Workshop Slides for Ladies Learning Code - March 22, 2014Processing Workshop Slides for Ladies Learning Code - March 22, 2014
Processing Workshop Slides for Ladies Learning Code - March 22, 2014
 
Getting Visual with Ruby Processing
Getting Visual with Ruby ProcessingGetting Visual with Ruby Processing
Getting Visual with Ruby Processing
 
Constructing my music magazine
Constructing my music magazineConstructing my music magazine
Constructing my music magazine
 
Learn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing LanguageLearn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing Language
 
Learn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing LanguageLearn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing Language
 
Photoshop text - My Experimentation
Photoshop text - My ExperimentationPhotoshop text - My Experimentation
Photoshop text - My Experimentation
 
1. production experiments
1. production experiments1. production experiments
1. production experiments
 
Photoshop textt
Photoshop texttPhotoshop textt
Photoshop textt
 
Animate The Web With Ember.js - Jessica Jordan
Animate The Web With Ember.js - Jessica JordanAnimate The Web With Ember.js - Jessica Jordan
Animate The Web With Ember.js - Jessica Jordan
 

Kürzlich hochgeladen

Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
Techgropse Pvt.Ltd.
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
Claudio Di Ciccio
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 

Kürzlich hochgeladen (20)

Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 

Creating Speech Bubbles in Jython

  • 1. How To Make A Speech Bubble By: Sweta Vajjhala There can be many different applications of picture-manipulation in JES. One of the best applications is making a comic strip. In these comic strips, there are often characters that say things. To indicate that a character is speaking, a speech bubble is often used. JES can be used to make speech bubbles for these characters. This tutorial is a step-by-step tutorial that will show an example of how to make a speech bubble. Our desired result is as follows: Assuming that all of this should be done inside of one function, then there are three main steps required in order to obtain the above result: 1) Make the canvas 2) Make & copy the character onto the canvas 3) Make the speech bubble & add it to the canvas.
  • 2. Making The Canvas First, we have to define a function: let’s call it makeSpeechBubble. Also, be sure to set your media path to the place where your character and canvas are located. We will also assume that we are making a picture from a pre-existing canvas, which has a size of 640x480 pixels. Once we add the canvas, we want the entire background to be white. So far, this is what our code looks like: def makeSpeechBubble(): canvas = makePicture(getMediaPath("640x480.jpg")) canvas.addRectFilled(white,1,1,640,480) Making And Copying The Character Onto The Canvas After making the canvas, the next step is to copy a character onto the canvas. In order to do this, first, we have to make the picture, which is similar to making the canvas. caterpillar = makePicture(getMediaPath("caterpillar.jpg")) The easiest way to copy the caterpillar onto the canvas is using two for loops. For each pixel (x,y), we will copy it onto the canvas at location (targetX,targetY), where the first value for targetX and targetY will start at the value where the top-left corner of the image should appear. targetX = 300 for x in range(1,getWidth(caterpillar)): targetY = 20 for y in range(1,getHeight(caterpillar)): c1 = getColor(getPixel(caterpillar,x,y)) setColor(getPixel(canvas,targetX,targetY),c1) targetY = targetY + 1 targetX = targetX + 1 This means that we will copy the caterpillar onto the canvas, and the top-left corner of the caterpillar will appear at (300,20) on the canvas. Making and Adding The Speech Bubble Onto The Canvas Now that we have a character that is copied onto the canvas, we have to make a speech bubble for the character. In order to make the bubble and add it to the canvas at the same time, there is a built-in JESS function called addOval. This function takes in five parameters (in the following order): color, startingX, startingY, width, height. This will give you an oval canvas.addOval(black,235,5,95,45) Now that we have our actual speech bubble, we need to put the speech inside of it! Just like there is an addOval function, JES also has a built-in addText function. The parameters for the addText function are: color, startingX, startingY, “text”. It is best to specify the startingX and the
  • 3. startingY somewhere inside the bubble. For example, the speech bubble itself starts at (235,5), so starting the text at (235,5) would not be a good idea. Instead, starting the text at (255,22) ensures that the entire text will appear inside the speech bubble. Since I was “CS1315!” to appear in a new line, I will start that text at (260,28). This will give the appearance that “CS1315!” is centered under “Hello! I love”. canvas.addText(blue,255,20,“Hello! I love”) canvas.addText(blue,260,38,“CS1315!”) After all of this is done, it is important to remember to return the canvas. If you want to save the final result, you can put in a writePictureTo statement, which will write the canvas to a file. However, if you want it to be executed, it must be placed before the return statement. writePictureTo(canvas,“C:SwetaGeorgia TechCS 1315 TAcaterpillar.jpg”) return canvas When you run this program, it should be run as follows: >>> setMediaPath() New media folder: C:Program FilesJESMediaSources >>> show(makeSpeechBubble()) After running this, the final result should be the picture above!