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
* what is an electronic mail ?
Vikki [24]

Answer:

Electronic mail is a method of exchanging messages between people using electronic devices. Email entered limited use in the 1960s, but users could only send to users of the same computer, and some early email systems required the author and the recipient to both be online simultaneously, similar to instant messaging.

6 0
3 years ago
15. You read a news article that's politically biased and not well organized. It's
kati45 [8]

You read a news article that's politically biased and not well organized. It's likely; A: A fake news

<h3>Understanding how to report a story</h3>

Let us look at each of the options given;

A: A fake news: This is a news that lacks credibility based on lack of proper research or evidence.

B: An indirect Citation; An indirect citation is when the ideas of one author are published in another author's text but then you have not read or accessed the original author's work.

C: A reliable source; This is a source that provides a thorough, well-reasoned theory, argument, discussion that is based on strong evidence.

D: A direct Citation; A direct citation is when you directly quote the exact words of an author or speaker.

Read more about reporting of a Story at; brainly.com/question/10111803

3 0
2 years ago
When it comes to safety, the choice to be safe is often up to __________?
DENIUS [597]
>>>>>>>>>>>> "You" <<<<<<<<<<<<<                                         

4 0
3 years ago
A technician is tasked to implement a wireless router that will have the fastest data transfer speed at 5 GHz frequency. Which o
Basile [38]

Answer:

Option B i.e.,802.11ac is the correct option.

Explanation:

Because 802.11ac is that standard that is selected by the technician to install that router which is wireless and that router has the fastest speed of the data transfering that is 5GHz frequency. Mostly, the following standard is used in the large organizations by which the work done on time without any restriction to access the internet. So, that's why the following option is correct.

7 0
3 years ago
I need major help. Word processing
Pie

Answer:

I do Word processing in computing, but I use a computing textbook for studies.

I also don't have any idea about the flashcards.

I'm sorry.

Explanation:

But if you want me to help, I may.

3 0
2 years ago
Other questions:
  • For any element in keysList with a value greater than 50, print the corresponding value in itemsList, followed by a space. Ex: I
    8·1 answer
  • Credit card numbers follow a standard system. For example, Visa, MasterCard, and Discpver Card all have 16 digits, and the first
    11·1 answer
  • Why ois my printer not printing pictjures?
    9·1 answer
  • Advancements in technology that might be helpful for individuals who need accommodations to perform computer tasks include _____
    15·2 answers
  • I'd like to edit a picture so that I can remove the background behind an object and have it replaced with a transparent backgrou
    13·2 answers
  • What is text box and label control​
    10·2 answers
  • My question is do you learn how to do a voice over in technology?
    14·1 answer
  • In paragraph form, explain and describe at least three common situations in which you would yield the right-of-way.
    5·1 answer
  • For enterprise servers, or servers accessed around the clock, SATA disks are preferred over SAS disks. True or False
    12·1 answer
  • Which statement about analog and digital images is true?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!