473,388 Members | 1,198 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

fefinining % of c'm'y and k

hello
i need a program (and pleas shoe me the modol in the softwar) that :
if i have a scaned photo
i want to define out of each poligon color ,as it seems in the photo,
the cmyk
in % (percets) of the color/
4 exampl from poligon color orang defin the cmyk in %
like that: (example)
c: 30%
m:56%
y:78%
k: 10%
moshe
thanks

Jul 18 '05 #1
1 1100
On Sun, Jan 16, 2005 at 09:57:46PM -0800, mo*****@shamaut.co.il wrote:
hello
i need a program (and pleas shoe me the modol in the softwar) that :
if i have a scaned photo
i want to define out of each poligon color ,as it seems in the photo,
the cmyk
in % (percets) of the color/
4 exampl from poligon color orang defin the cmyk in %
like that: (example)
c: 30%
m:56%
y:78%
k: 10%
moshe
thanks


if I understand you correctly, then what you want to do is to
determine the amounts of each color an image has. I can think of two
ways of doing this, both using PIL; one faster,

img = Image.open('foo.png')
dot = img.resize((1,1),1)
avg = dot.getpixel((0,0))
for i in zip(dot.getbands(), avg):
print "%s: %s" % i

and the other, thorougher

img = Image.open('foo.png')
width, height = img.size
numdots = width*height
avg = [sum(i)/numdots
for i in zip(*[img.getpixel((x,y))
for x in xrange(width)
for y in xrange(height)])]
for i in zip(dot.getbands(), avg):
print "%s: %s" % i

the first is usually pretty close to the second, but YMMV.

Converting from these image-specific average values to CMYK is a
non-trivial problem (impossible in the general casew); see for example
http://groups-beta.google.com/group/...0c54513c4970f7
where this issue was discussed.

--
John Lenton (jo**@grulic.org.ar) -- Random fortune:
Excellent day to have a rotten day.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFB615IgPqu395ykGsRAhi7AKDKHdBItA5NfVWgVuTukp JFzrSa9QCfRkwu
1HxiAKGqsMlZVgsmcOCKZTA=
=UE+5
-----END PGP SIGNATURE-----

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Johan Holst Nielsen | last post by:
Hi all, I hope someone can help me. I have do do a color conversion from RGB to CMYK. It's harder than I thought :D Anyway, here is my problem. I tried some differents ways to do it - I...
43
by: Dom | last post by:
can someone please help me display text in the console cout << "Testing"; in a different colour to the default one
2
by: AllenL | last post by:
Ever since I've been using objects with VB I've instantiated the business object from the form; the business object then creates/destroys data access layer objects as needed. The business object...
59
by: pamelafluente | last post by:
Hi, If I have: <div style="background:anyColorHere"Hi </div> where anyColorHere is any hex string that represent a valid color. How can I invert that background color "anyColorHere" ? Can...
1
by: lyndon | last post by:
Can anyone tell me how to save the values of structure to a file so that i can reaload them later? Dim fxFixture as new Fixture Dim fxFixture2 as new Fixture fxFixture.Model = "ModelName"...
3
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
Hi, I am developing an app where customer post request via a website, the request, upon receipt by the office, must the be pushed to respective mobile PDAs.n The requests are sort of order pickup....
4
by: Chris | last post by:
My bosses look like they're going to buy in Visual Studio and let us upgrade from ASP to ASP.net - don't ask :) I am doing my research but one thing is confusing me. One thing I really want is...
16
by: copx | last post by:
I have recently read "Everything you ever wanted to know about C types" by Peter Seebach (1), and learned about incomplete types. Now, I realise the value of encapsulation, but I wonder whether it...
7
by: c_shah | last post by:
I have an asp.net website (IIS 6 on windows Server 2003, .NET Framework 2.0) On one of my page I am making a call to a ASP.net web service (to obtain some data), I DO NOT want to make any...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.