Answered step by step
Verified Expert Solution
Question
1 Approved Answer
May I please know how to program this question in python? Thank you. You are tasked with writing a program that will create a linear
May I please know how to program this question in python? Thank you.
You are tasked with writing a program that will create a linear interpolation between two pixels. You are to read in two pixel values and generate a number of pixels specified between them.
For example:
Input for the program Enter the first colour: 0x002222 Enter the second colour: 8xFFDD33 Enter the number of colours to generate inbetween: 3 Using the 2 pixels specified it will generate 3 new pixels between the first and last pixel. You will need to round the difference of each channel between the larger and smaller pixel. (Edit, I have updated it so you need to round the channels not the pixels themselves). You will find the channel (Red, Green, Blue) difference between the two pixels and divide by the number of total pixels create the new pixels Colours: 0x002222 0x405126 0x80802a 0xceaf2e 0xffdd33 Your program will need to swap the starting pixel (or smallest) out of the two that were inputted should be the first colour shown while the larger pixel should be the last pixel specified
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started