1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
erica [24]
3 years ago
6

How to write a program converting RGB to CMYK in python

Computers and Technology
1 answer:
Arisa [49]3 years ago
5 0

rgb_scale = 255

cmyk_scale = 100

def rgb_to_cmyk(r,g,b):

if (r == 0) and (g == 0) and (b == 0):

return 0, 0, 0, cmyk_scale

# rgb [0,255] -> cmy [0,1]

c = 1 - r / float(rgb_scale)

m = 1 - g / float(rgb_scale)

y = 1 - b / float(rgb_scale)

min_cmy = min(c, m, y)

c = (c - min_cmy)

m = (m - min_cmy)

y = (y - min_cmy)

k = min_cmy

return c*cmyk_scale, m*cmyk_scale, y*cmyk_scale, k*cmyk_scale

def cmyk_to_rgb(c,m,y,k):

r = rgb_scale*(1.0-(c+k)/float(cmyk_scale))

g = rgb_scale*(1.0-(m+k)/float(cmyk_scale))

b = rgb_scale*(1.0-(y+k)/float(cmyk_scale))

return r,g,b

You might be interested in
This is the most flexible way to create a query. Used to create queries that displays only the records that match criteria enter
Pachacha [2.7K]

Answer:

Query Wizard

Explanation:

We can use the Query Wizard to automatically create a selection query, but in this case, we have less control in our details of the query design, it's the fastest way to create a query, even detect some design errors.

Steps to use the Query Wizard

1) In the Queries group on the Create, click Query Wizard

2) Add fields

3) On the last page of the wizard, add a title to the query

6 0
2 years ago
can someone help me write a 5 paragraph essay on microsoft word and why we need and how we use it? if you can please make it sou
DaniilM [7]
Here are some important points:
- we use it to do essays for school
- we can use it to do flyers for recreational events
- we can use it to do pamphlets to inform people
- it is versatile, so you can create many different types of documents
- you can create charts

This can be your opening statement

Today, there is a lot asked of a child in school. From charts to essay to projects, the average kid has at least 10 different programs they use just for one project. But there is one program that came along and changed everything, and that program is called Microsoft word. Microsoft word is valuable because it is versatile (what I wrote earlier about it being able to do many different tasks), it simplifies your experience (what i said about it being able to combine different programs into one), and it is free (you can write about how some programs charge to use their high-grade programs but microsoft is free and avaialabe on every windows
computer.)

GOOD LUCK !
4 0
3 years ago
When using social​ media, make sure to provide access to all the information needed to accurately process messages by following
Nataly_w [17]

Answer:

Option E i.e., transparency is the correct option.

Explanation:

When any person using social media networks the he always ensure that he gives all the information related accurately about himself because in the social media network there is the transparency of everything except his chat with other but any person get details of the other person only if he is using social media network.

4 0
3 years ago
Write a program that calculates and displays the amount ofmoney available in a bank account that initially has $8000 deposited i
Leviafan [203]

Answer:

Written in Python

import math

principal = 8000

rate = 0.025

for i in range(1, 11):

    amount = principal + principal * rate

    principal = amount

    print("Year "+str(i)+": "+str(round(amount,2)))

Explanation:

This line imports math library

import math

This line initializes principal amount to 8000

principal = 8000

This line initializes rate to 0.025

rate = 0.025

The following is an iteration from year 1 to 10

for i in range(1, 11):

    This calculates the amount at the end of the year

    amount = principal + principal * rate

    This calculates the amount at the beginning of the next year

    principal = amount

    This prints the calculated amount

    print("Year "+str(i)+": "+str(round(amount,2)))

6 0
3 years ago
TQ Automation<br> What is Robotic Process Automation (RPA)?
tamaranim1 [39]

Answer:

RPA or Robotic Process Automation allows organizations to automate tasks which human beings were doing across any applications and systems. The purpose of RPA is to transfer the execution of the process from humans to robots.

5 0
1 year ago
Other questions:
  • Janis is preparing a financial document. She needs to use the dollar symbol placed above the number key 4. Which key will Janis
    12·2 answers
  • What are ways to enter a formula in Excel? Check all that apply. Click on the Function Library group and select a function from
    10·2 answers
  • Which view is used to allow a publisher to view facing pages of a publication at the same time? Normal Master Page Two-Page Spre
    5·1 answer
  • What year did buck tooth bob become famous
    11·2 answers
  • If there are 18 people in your class and you want to divide the class into programming teams of 3
    7·1 answer
  • Correct all the mistakes in the following sentence:
    15·2 answers
  • Python program oranges and apples 3.4.6 copy and paste would be nice
    7·1 answer
  • Avi does not want to save his internet browsing details on his computer. What should he do?
    11·1 answer
  • When delivering digital technologies to clients, what is a best practice to make those solutions sustainable?
    10·1 answer
  • A CPU scheduler that assigns higher priority to the I/O-bound processes than the CPU-bound processes causes:
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!