SlideShare a Scribd company logo
1 of 2
Download to read offline
I need an explanation on what the function of the number "1.428" in the following code, could
you explain it please? I have provided the code below
from PIL import Image
def fix_middle(picture):
# Swapping the red and green components in the middle of the picture
# The middle is defined as a rectangular space
# 100% of the picture height and
# 50% of the picture width centered horizontally.
width, height = picture.size
for x in range(width):
for y in range(height):
if x in range(int(width/4),int(width/4)+int(width/2)) and y in range(height):
r,g,b = picture.getpixel((x,y))
picture.putpixel((x,y),(g,r,b))
return picture
def fix_top_half(picture):
# Changing each pure yellow pixel on the top half of the image to white
# Pure yellow pixels have the red and green components maximized and the blue component
minimized
width, height = picture.size
for x in range(width):
for y in range(height):
if x in range(width) and y in range(int(height/2)):
r,g,b = picture.getpixel((x,y))
if r == 255 and g == 255 and b == 0:
picture.putpixel((x,y),(255,255,255))
return picture
def make_rect_varyh(picture):
# Rectangle upper left corner: (10% of the picture width, 70% of the picture height)
# Rectangle height: 5% of the picture height
# Rectangle width: 80% of the picture width
# Rectangle color varies from black to pure blue as the rectangle is traversed horizontally
from left to right
width, height = picture.size
for x in range(width):
for y in range(height):
if x in range(int(width/10),int(width/10)+int(width/1.25)) and y in
range(int(height/1.428),int(height/1.428)+int(height/20)):
r,g,b = picture.getpixel((x,y))
picture.putpixel((x,y),(0,0,int((x-int(width/10))/(width/1.25)*255)))
return picture
from PIL import Image
def fix_file(file_name):
# Open the file_name indicated to obtain a picture
# Call the helper functions: fox middle (picture) fix top_half (picture) make_rect_varyh
(picture)
# Show only the final picture to verify the changes
# Save the final picture as "final.png"
picture = Image.open("stop_colored.png")
picture = fix_middle(picture)
picture = fix_top_half(picture)
picture = make_rect_varyh(picture)
picture.show()
picture.save("final.png")
fix_file("stop_colored.png")

More Related Content

Similar to I need an explanation on what the function of the number 1.428 in .pdf

Digital Image Processing (Lab 05)
Digital Image Processing (Lab 05)Digital Image Processing (Lab 05)
Digital Image Processing (Lab 05)Moe Moe Myint
 
Intensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringIntensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringShajun Nisha
 
Simple Matlab tutorial using matlab inbuilt commands
Simple Matlab tutorial using matlab inbuilt commandsSimple Matlab tutorial using matlab inbuilt commands
Simple Matlab tutorial using matlab inbuilt commandsLakshmi Sarvani Videla
 
DIP-Enhancement-Spatial.pptx
DIP-Enhancement-Spatial.pptxDIP-Enhancement-Spatial.pptx
DIP-Enhancement-Spatial.pptxNidhiSharma764884
 
Frequency Image Processing
Frequency Image ProcessingFrequency Image Processing
Frequency Image ProcessingSuhas Deshpande
 
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...IJSRD
 

Similar to I need an explanation on what the function of the number 1.428 in .pdf (8)

Digital Image Processing (Lab 05)
Digital Image Processing (Lab 05)Digital Image Processing (Lab 05)
Digital Image Processing (Lab 05)
 
present
presentpresent
present
 
Intensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringIntensity Transformation and Spatial filtering
Intensity Transformation and Spatial filtering
 
h.pdf
h.pdfh.pdf
h.pdf
 
Simple Matlab tutorial using matlab inbuilt commands
Simple Matlab tutorial using matlab inbuilt commandsSimple Matlab tutorial using matlab inbuilt commands
Simple Matlab tutorial using matlab inbuilt commands
 
DIP-Enhancement-Spatial.pptx
DIP-Enhancement-Spatial.pptxDIP-Enhancement-Spatial.pptx
DIP-Enhancement-Spatial.pptx
 
Frequency Image Processing
Frequency Image ProcessingFrequency Image Processing
Frequency Image Processing
 
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
 

More from pratyushraj61

helphelp Regarding the numerou.pdf
helphelp Regarding the numerou.pdfhelphelp Regarding the numerou.pdf
helphelp Regarding the numerou.pdfpratyushraj61
 
Hello. Im having trouble trying to set the condition where once the .pdf
Hello. Im having trouble trying to set the condition where once the .pdfHello. Im having trouble trying to set the condition where once the .pdf
Hello. Im having trouble trying to set the condition where once the .pdfpratyushraj61
 
Henrich is a single taxpayer. In 2022, his taxable income is $478,0.pdf
Henrich is a single taxpayer.  In 2022, his taxable income is $478,0.pdfHenrich is a single taxpayer.  In 2022, his taxable income is $478,0.pdf
Henrich is a single taxpayer. In 2022, his taxable income is $478,0.pdfpratyushraj61
 
Hi could you focus on the isohyetal method and thiessen polygon me.pdf
Hi could you focus on the isohyetal method and thiessen polygon me.pdfHi could you focus on the isohyetal method and thiessen polygon me.pdf
Hi could you focus on the isohyetal method and thiessen polygon me.pdfpratyushraj61
 
helpppppp((( The difference between an embedded object and a linked.pdf
helpppppp((( The difference between an embedded object and a linked.pdfhelpppppp((( The difference between an embedded object and a linked.pdf
helpppppp((( The difference between an embedded object and a linked.pdfpratyushraj61
 
help on this thanks. Phalaropes are shore birds with brightly col.pdf
help on this thanks.  Phalaropes are shore birds with brightly col.pdfhelp on this thanks.  Phalaropes are shore birds with brightly col.pdf
help on this thanks. Phalaropes are shore birds with brightly col.pdfpratyushraj61
 
I have an independent food delivery platform having a lot of differe.pdf
I have an independent food delivery platform having a lot of differe.pdfI have an independent food delivery platform having a lot of differe.pdf
I have an independent food delivery platform having a lot of differe.pdfpratyushraj61
 
i need programingi need programing ai. Create o Va opplication t.pdf
i need programingi need programing ai. Create o Va opplication t.pdfi need programingi need programing ai. Create o Va opplication t.pdf
i need programingi need programing ai. Create o Va opplication t.pdfpratyushraj61
 
I need help with making a program that can be part of a google forms.pdf
I need help with making a program that can be part of a google forms.pdfI need help with making a program that can be part of a google forms.pdf
I need help with making a program that can be part of a google forms.pdfpratyushraj61
 
I need help fixing my assembly program please, I keep getting a segm.pdf
I need help fixing my assembly program please, I keep getting a segm.pdfI need help fixing my assembly program please, I keep getting a segm.pdf
I need help fixing my assembly program please, I keep getting a segm.pdfpratyushraj61
 
I need help getting my code to work (code is at the bottom)1.3.pdf
I need help getting my code to work (code is at the bottom)1.3.pdfI need help getting my code to work (code is at the bottom)1.3.pdf
I need help getting my code to work (code is at the bottom)1.3.pdfpratyushraj61
 
Hewitt Packaging Companynin �denmemi 14 kupon faiz oranyla 1.000 A.pdf
Hewitt Packaging Companynin �denmemi 14 kupon faiz oranyla 1.000 A.pdfHewitt Packaging Companynin �denmemi 14 kupon faiz oranyla 1.000 A.pdf
Hewitt Packaging Companynin �denmemi 14 kupon faiz oranyla 1.000 A.pdfpratyushraj61
 
I need help coming up with a MIPS program for this.1.3. Overvi.pdf
I need help coming up with a MIPS program for this.1.3. Overvi.pdfI need help coming up with a MIPS program for this.1.3. Overvi.pdf
I need help coming up with a MIPS program for this.1.3. Overvi.pdfpratyushraj61
 
I need help being able to enable different voting types such as publ.pdf
I need help being able to enable different voting types such as publ.pdfI need help being able to enable different voting types such as publ.pdf
I need help being able to enable different voting types such as publ.pdfpratyushraj61
 
I have this Koch Python code but isnt working. Can some please revi.pdf
I have this Koch Python code but isnt working. Can some please revi.pdfI have this Koch Python code but isnt working. Can some please revi.pdf
I have this Koch Python code but isnt working. Can some please revi.pdfpratyushraj61
 
How do zoned reserves manage relations with local people1. Zone.pdf
How do zoned reserves manage relations with local people1. Zone.pdfHow do zoned reserves manage relations with local people1. Zone.pdf
How do zoned reserves manage relations with local people1. Zone.pdfpratyushraj61
 
I have included the person.h file code. 1-4 In a file called functio.pdf
I have included the person.h file code. 1-4 In a file called functio.pdfI have included the person.h file code. 1-4 In a file called functio.pdf
I have included the person.h file code. 1-4 In a file called functio.pdfpratyushraj61
 
Here is my code for a linefile editor import java.io.BufferedRea.pdf
Here is my code for a linefile editor import java.io.BufferedRea.pdfHere is my code for a linefile editor import java.io.BufferedRea.pdf
Here is my code for a linefile editor import java.io.BufferedRea.pdfpratyushraj61
 
I have a question regarding extreme value analysis.I fitted a gene.pdf
I have a question regarding extreme value analysis.I fitted a gene.pdfI have a question regarding extreme value analysis.I fitted a gene.pdf
I have a question regarding extreme value analysis.I fitted a gene.pdfpratyushraj61
 
I concur, technology is so engrained in our day-to-day activities (w.pdf
I concur, technology is so engrained in our day-to-day activities (w.pdfI concur, technology is so engrained in our day-to-day activities (w.pdf
I concur, technology is so engrained in our day-to-day activities (w.pdfpratyushraj61
 

More from pratyushraj61 (20)

helphelp Regarding the numerou.pdf
helphelp Regarding the numerou.pdfhelphelp Regarding the numerou.pdf
helphelp Regarding the numerou.pdf
 
Hello. Im having trouble trying to set the condition where once the .pdf
Hello. Im having trouble trying to set the condition where once the .pdfHello. Im having trouble trying to set the condition where once the .pdf
Hello. Im having trouble trying to set the condition where once the .pdf
 
Henrich is a single taxpayer. In 2022, his taxable income is $478,0.pdf
Henrich is a single taxpayer.  In 2022, his taxable income is $478,0.pdfHenrich is a single taxpayer.  In 2022, his taxable income is $478,0.pdf
Henrich is a single taxpayer. In 2022, his taxable income is $478,0.pdf
 
Hi could you focus on the isohyetal method and thiessen polygon me.pdf
Hi could you focus on the isohyetal method and thiessen polygon me.pdfHi could you focus on the isohyetal method and thiessen polygon me.pdf
Hi could you focus on the isohyetal method and thiessen polygon me.pdf
 
helpppppp((( The difference between an embedded object and a linked.pdf
helpppppp((( The difference between an embedded object and a linked.pdfhelpppppp((( The difference between an embedded object and a linked.pdf
helpppppp((( The difference between an embedded object and a linked.pdf
 
help on this thanks. Phalaropes are shore birds with brightly col.pdf
help on this thanks.  Phalaropes are shore birds with brightly col.pdfhelp on this thanks.  Phalaropes are shore birds with brightly col.pdf
help on this thanks. Phalaropes are shore birds with brightly col.pdf
 
I have an independent food delivery platform having a lot of differe.pdf
I have an independent food delivery platform having a lot of differe.pdfI have an independent food delivery platform having a lot of differe.pdf
I have an independent food delivery platform having a lot of differe.pdf
 
i need programingi need programing ai. Create o Va opplication t.pdf
i need programingi need programing ai. Create o Va opplication t.pdfi need programingi need programing ai. Create o Va opplication t.pdf
i need programingi need programing ai. Create o Va opplication t.pdf
 
I need help with making a program that can be part of a google forms.pdf
I need help with making a program that can be part of a google forms.pdfI need help with making a program that can be part of a google forms.pdf
I need help with making a program that can be part of a google forms.pdf
 
I need help fixing my assembly program please, I keep getting a segm.pdf
I need help fixing my assembly program please, I keep getting a segm.pdfI need help fixing my assembly program please, I keep getting a segm.pdf
I need help fixing my assembly program please, I keep getting a segm.pdf
 
I need help getting my code to work (code is at the bottom)1.3.pdf
I need help getting my code to work (code is at the bottom)1.3.pdfI need help getting my code to work (code is at the bottom)1.3.pdf
I need help getting my code to work (code is at the bottom)1.3.pdf
 
Hewitt Packaging Companynin �denmemi 14 kupon faiz oranyla 1.000 A.pdf
Hewitt Packaging Companynin �denmemi 14 kupon faiz oranyla 1.000 A.pdfHewitt Packaging Companynin �denmemi 14 kupon faiz oranyla 1.000 A.pdf
Hewitt Packaging Companynin �denmemi 14 kupon faiz oranyla 1.000 A.pdf
 
I need help coming up with a MIPS program for this.1.3. Overvi.pdf
I need help coming up with a MIPS program for this.1.3. Overvi.pdfI need help coming up with a MIPS program for this.1.3. Overvi.pdf
I need help coming up with a MIPS program for this.1.3. Overvi.pdf
 
I need help being able to enable different voting types such as publ.pdf
I need help being able to enable different voting types such as publ.pdfI need help being able to enable different voting types such as publ.pdf
I need help being able to enable different voting types such as publ.pdf
 
I have this Koch Python code but isnt working. Can some please revi.pdf
I have this Koch Python code but isnt working. Can some please revi.pdfI have this Koch Python code but isnt working. Can some please revi.pdf
I have this Koch Python code but isnt working. Can some please revi.pdf
 
How do zoned reserves manage relations with local people1. Zone.pdf
How do zoned reserves manage relations with local people1. Zone.pdfHow do zoned reserves manage relations with local people1. Zone.pdf
How do zoned reserves manage relations with local people1. Zone.pdf
 
I have included the person.h file code. 1-4 In a file called functio.pdf
I have included the person.h file code. 1-4 In a file called functio.pdfI have included the person.h file code. 1-4 In a file called functio.pdf
I have included the person.h file code. 1-4 In a file called functio.pdf
 
Here is my code for a linefile editor import java.io.BufferedRea.pdf
Here is my code for a linefile editor import java.io.BufferedRea.pdfHere is my code for a linefile editor import java.io.BufferedRea.pdf
Here is my code for a linefile editor import java.io.BufferedRea.pdf
 
I have a question regarding extreme value analysis.I fitted a gene.pdf
I have a question regarding extreme value analysis.I fitted a gene.pdfI have a question regarding extreme value analysis.I fitted a gene.pdf
I have a question regarding extreme value analysis.I fitted a gene.pdf
 
I concur, technology is so engrained in our day-to-day activities (w.pdf
I concur, technology is so engrained in our day-to-day activities (w.pdfI concur, technology is so engrained in our day-to-day activities (w.pdf
I concur, technology is so engrained in our day-to-day activities (w.pdf
 

Recently uploaded

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 

Recently uploaded (20)

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 

I need an explanation on what the function of the number 1.428 in .pdf

  • 1. I need an explanation on what the function of the number "1.428" in the following code, could you explain it please? I have provided the code below from PIL import Image def fix_middle(picture): # Swapping the red and green components in the middle of the picture # The middle is defined as a rectangular space # 100% of the picture height and # 50% of the picture width centered horizontally. width, height = picture.size for x in range(width): for y in range(height): if x in range(int(width/4),int(width/4)+int(width/2)) and y in range(height): r,g,b = picture.getpixel((x,y)) picture.putpixel((x,y),(g,r,b)) return picture def fix_top_half(picture): # Changing each pure yellow pixel on the top half of the image to white # Pure yellow pixels have the red and green components maximized and the blue component minimized width, height = picture.size for x in range(width): for y in range(height): if x in range(width) and y in range(int(height/2)): r,g,b = picture.getpixel((x,y)) if r == 255 and g == 255 and b == 0: picture.putpixel((x,y),(255,255,255)) return picture def make_rect_varyh(picture): # Rectangle upper left corner: (10% of the picture width, 70% of the picture height) # Rectangle height: 5% of the picture height # Rectangle width: 80% of the picture width # Rectangle color varies from black to pure blue as the rectangle is traversed horizontally from left to right width, height = picture.size for x in range(width):
  • 2. for y in range(height): if x in range(int(width/10),int(width/10)+int(width/1.25)) and y in range(int(height/1.428),int(height/1.428)+int(height/20)): r,g,b = picture.getpixel((x,y)) picture.putpixel((x,y),(0,0,int((x-int(width/10))/(width/1.25)*255))) return picture from PIL import Image def fix_file(file_name): # Open the file_name indicated to obtain a picture # Call the helper functions: fox middle (picture) fix top_half (picture) make_rect_varyh (picture) # Show only the final picture to verify the changes # Save the final picture as "final.png" picture = Image.open("stop_colored.png") picture = fix_middle(picture) picture = fix_top_half(picture) picture = make_rect_varyh(picture) picture.show() picture.save("final.png") fix_file("stop_colored.png")