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 the main idea of this article? Please someone help me. I will give brainliest answer
mart [117]
The main idea of this article is that theme parks are conducting scientific research that is benefiting the community. Hope this helps!
8 0
3 years ago
What does it mean to prioritize tasks?
salantis [7]

Answer:

to rank tasks from most to least important

Explanation:

Prioritize means to choose priority, obviously and priority is the thing is the thing which, among other things, have the biggest importance.

Every day, especially in business, one finds himself swimming in tasks up to his neck. Obviously, not all of them can be successfully finished, or at least not without sacrificing one's personal life or sleep.

Prioritizing, therefore, serves as a helpful organising tool. After writing down all tasks that need to be done, a person should rank them by priority, which means that only urgent and important tasks will be dealt with immediately. Tasks of lower priority will be postponed, delegated or simply deleted.

6 0
2 years ago
Read 2 more answers
Difference between multi-national and global company​
trapecia [35]

A multinational corporation, or MNC, is a company which produces goods and services and has offices in several other countries while a global corporation or company is a company which also has trade relations with several other countries. ... MNCs have official headquarters while global companies do not.

5 0
3 years ago
Read 2 more answers
Consider an error-free 64 kbps satellite channel used to send 512 byte data frames in one direction, with very short acknowledge
Vladimir [108]

Answer:

The answer is "2".

Explanation:

In the given question some information is missing, that is "The propagation time for satellite to earth" which is "270 milliseconds" so, the description to this question can be defined as follows:

Given values:

Bandwidth = 64 kbps

Data frames = 512 bytes  

Propagation Time (t​​​​​​p ) =270 ms

Change Bandwidth  kbps to bps:

1 kb= 1024 bytes

calculated bandwidth= 64 kbps = 64×1024 bps = 65536 bps

1 bytes = 8 bits

512 bytes = 512 × 8 =  4096 bits

Frame length = 4096 bits

Formula

Transmission time (T​​​​​​t) = Frame length /Bandwidth

Window size = 1+2a

where a = Propagation time/Transmission time

Calculate Transmission time:

Transmission time (T​​​​​​t) = 4096 / 65536

Transmission time (T​​​​​​t)= 625 m.sec

Calculate Window size:

Window size = 1+2(270/625)

Window size = 1+2(0.432)

Window size = 1+0.864

Window size = 1.864

Window size = 2

3 0
3 years ago
PLEASE HELP ME!!!!!
gizmo_the_mogwai [7]

Answer:

Unicode

Explanation:

This is a fairly large code and Is well known throughout my family since we study ancient codex and modern codes to solve crimes and find relics of the past, although our research has proven good and unicode is one that is being studied currently now, I have found it as long and very time consuming. Although ASCII is a computer code that consists of graphs and numbers it actually shortens the text. and hexadecimal has been proven to be less reliable and binary is a short code with little symbols

8 0
2 years ago
Read 2 more answers
Other questions:
  • Does the steelseries arctis 9x work with a pcie bluetooth card in windows
    13·1 answer
  • Which best describes inserting a table using the Table Gallery
    10·2 answers
  • Sulfur content is measured in
    11·1 answer
  • Which of the following is not given to a client computer when it is first installed on a TCP/IP network so that it has the appro
    9·1 answer
  • What is the best kernel synchronization solution on multicore systems when a lock is held for brief periods ?
    14·1 answer
  • Which term refers to the blank areas surrounding a document page? *
    15·1 answer
  • You can use colors, patterns, and borders to enhance the overall appearance of a worksheet and to make it easier to read. One of
    11·1 answer
  • Is the following statement true or false?
    12·1 answer
  • Write an application that determines whether the first two files are located in the same folder as the third one. The program sh
    6·1 answer
  • Select the correct answer..
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!