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
An operating system is defined as hardware that converts software into a useful form for applications.
marissa [1.9K]

Hardware that transforms software into a form that is helpful for applications is referred to as an operating system. False. Hardware conversion is done by software.

<h3>What is an operating system?</h3>
  • Computer hardware and software resources are managed by an operating system (OS), which also offers common functions for software programs.
  • Operating systems that use time-sharing plan activities to make the most of the system's resources.
  • They may also contain accounting software to allocate costs for processing time, mass storage, printing, and other resources.
  • An operating system (OS) is a piece of software that controls all of the other application programs in a computer after being originally loaded by a boot program.
  • Through a specified application program interface, the application programs seek services from the operating system (API).

To learn more about operating system, refer to:

brainly.com/question/22811693

#SPJ4

4 0
1 year ago
Which line of code will only allow a symbol to be stored in a variable?
nataly862011 [7]
<h2>Answer:</h2><h2></h2><h2>phone = int(input("What is your phone number?"))</h2><h2></h2><h2>Hope this helps, have a great day, stay safe, and positive!!</h2>

8 0
3 years ago
Read 2 more answers
Select the correct answer.
kicyunya [14]

Answer:

D

Explanation:

pecialisation - departments focus on one area of work. productivity - specialism means that staff are skilled in the tasks they do. accountability - there are clear lines of management. clarity - employees understand their own and others' roles.

7 0
3 years ago
Read 2 more answers
over time, you have noticed unauthorized configuration changes made to virtual machine cloud settings. you need a way to track w
Nuetrik [128]

One way to track who made these changes to the virtual machine cloud settings and when is to: D. enable cloud resource activity auditing.

<h3>What is a cloud?</h3>

In Computer technology, a cloud can be defined as the elastic leasing of pooled computer resources such as physical hardware through virtualization and over the Internet, so as to enable the storage and sharing of files and documents virtually and in real-time.

In this scenario, we can reasonably infer and logically conclude that one way to track who made these changes to the virtual machine cloud settings and when is to enable cloud resource activity auditing because it would provide a log of actions such as information about the engineer who made configuration changes.

Read more on a virtual machine here: brainly.com/question/12060797

#SPJ1

Complete Question:

Over time, you have noticed unauthorized configuration changes made to virtual machine cloud settings. You need a way to track who made these changes and when. What should you do?

A. Enable virtual machine API integration.

B. Rotate the cloud access keys.

C. Deploy an OSI layer 7 firewall.

D. Enable cloud resource activity auditing.

7 0
1 year ago
State four reasons why office automation is adopted in business establishment?​
olasank [31]

Answer:

The benefits of automated operations are higher productivity, reliability, availability, increased performance, and reduced operating costs.

Explanation:

6 0
3 years ago
Other questions:
  • Whenever I go onto Google Chrome, the words are in Spanish! How can I make the words be back in English again? Please let me kno
    7·1 answer
  • Assuming your computer only has one network card installed; explain how your virtual machine is able to share that card with you
    10·1 answer
  • 13) What are the benefits and detriments of each of the following? Consider both the systems and the programmers’ levels. a. Sym
    14·1 answer
  • How do you know if something is in the public domain
    5·1 answer
  • You need to extract data from the system your predecessor created. you discover tables have been created according to the third
    7·1 answer
  • NEED HELP FAST timed
    13·1 answer
  • What is the output of this program? Assume the user enters 2, 5, and 10.
    6·1 answer
  • 1. List three tabs that make up the Ribbon
    14·1 answer
  • Online platforms that allow users to represent themselves via a profile on a web site and provide and receive links to other net
    11·1 answer
  • A vlan ________.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!