473,409 Members | 1,942 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,409 software developers and data experts.

Colour values form a bitmap

MS
I need to determine CMYK values from bitmaps. Is there a way in VB or Access
to do this?

The reason is that I need to determin the relative CMYK values.

Example: A square with the bottom half filled with black would have a black
value of 50%. The same square with the bottom half filled with red would
have values C=0, M=50%, Y=50%, K=0 and so on.

At the moment we're putting a small version of the image into a paint
program, flattening it (or "infinitely" blurring it) and sampling the
resulting colour and manually extracting the CMYK values from that.

This is clumsy, and time consuming requiring manual entry of the figures -
it'd be great if there was a way to automate the process and then enter the
CMYK density values into a data base for each image.

Any ideas?
Nov 13 '05 #1
3 2467
"MS" <Em***@Myemail.com> wrote in message news:<Xl*******************@news-server.bigpond.net.au>...
I need to determine CMYK values from bitmaps. Is there a way in VB or Access
to do this?

The reason is that I need to determin the relative CMYK values.

Example: A square with the bottom half filled with black would have a black
value of 50%. The same square with the bottom half filled with red would
have values C=0, M=50%, Y=50%, K=0 and so on.

At the moment we're putting a small version of the image into a paint
program, flattening it (or "infinitely" blurring it) and sampling the
resulting colour and manually extracting the CMYK values from that.

This is clumsy, and time consuming requiring manual entry of the figures -
it'd be great if there was a way to automate the process and then enter the
CMYK density values into a data base for each image.

Any ideas?


I've not had to deal with CMYK values yet, but I posted code to this
NG entitled "VBA code to extract PDF stream from BMP (long)" on Mar
18, 2004 that grabs the RGB data from a bmp file. The PDF Reference
v. 1.5 pp. 242-243 talks about a Tint Transformation Function that may
enable you to convert the RGB values into CMYK format. It sounds like
you do not need to use the hexidecimal values required for PDF streams
so you can use the raw values.

James A. Fortune
Nov 13 '05 #2
MS

"James Fortune" <ja******@oakland.edu> wrote in message
news:a6**************************@posting.google.c om...
"MS" <Em***@Myemail.com> wrote in message

news:<Xl*******************@news-server.bigpond.net.au>...
I need to determine CMYK values from bitmaps. Is there a way in VB or Access to do this?

The reason is that I need to determin the relative CMYK values.

Example: A square with the bottom half filled with black would have a black value of 50%. The same square with the bottom half filled with red would
have values C=0, M=50%, Y=50%, K=0 and so on.

At the moment we're putting a small version of the image into a paint
program, flattening it (or "infinitely" blurring it) and sampling the
resulting colour and manually extracting the CMYK values from that.

This is clumsy, and time consuming requiring manual entry of the figures - it'd be great if there was a way to automate the process and then enter the CMYK density values into a data base for each image.

Any ideas?


I've not had to deal with CMYK values yet, but I posted code to this
NG entitled "VBA code to extract PDF stream from BMP (long)" on Mar
18, 2004 that grabs the RGB data from a bmp file. The PDF Reference
v. 1.5 pp. 242-243 talks about a Tint Transformation Function that may
enable you to convert the RGB values into CMYK format. It sounds like
you do not need to use the hexidecimal values required for PDF streams
so you can use the raw values.

James A. Fortune


Thank you.

I'll check that out.

Cheers!
Nov 13 '05 #3
"MS" <Em***@Myemail.com> wrote in message news:<N_*******************@news-server.bigpond.net.au>...
"James Fortune" <ja******@oakland.edu> wrote in message
news:a6**************************@posting.google.c om...
"MS" <Em***@Myemail.com> wrote in message

news:<Xl*******************@news-server.bigpond.net.au>...
I need to determine CMYK values from bitmaps. Is there a way in VB or Access to do this?

The reason is that I need to determin the relative CMYK values.

Example: A square with the bottom half filled with black would have a black value of 50%. The same square with the bottom half filled with red would
have values C=0, M=50%, Y=50%, K=0 and so on.

At the moment we're putting a small version of the image into a paint
program, flattening it (or "infinitely" blurring it) and sampling the
resulting colour and manually extracting the CMYK values from that.

This is clumsy, and time consuming requiring manual entry of the figures - it'd be great if there was a way to automate the process and then enter the CMYK density values into a data base for each image.

Any ideas?


I've not had to deal with CMYK values yet, but I posted code to this
NG entitled "VBA code to extract PDF stream from BMP (long)" on Mar
18, 2004 that grabs the RGB data from a bmp file. The PDF Reference
v. 1.5 pp. 242-243 talks about a Tint Transformation Function that may
enable you to convert the RGB values into CMYK format. It sounds like
you do not need to use the hexidecimal values required for PDF streams
so you can use the raw values.

James A. Fortune


Thank you.

I'll check that out.

Cheers!


After writing that code I came across the following book:

Print Programming in Windows
Potts, Jeff
CMP Books
2000
ISBN: 0879305851

He has lots of code in both VB and C to deal with printing. His code
is quite a bit more elegant than mine. He has some examples that
relate to bmp files. The only thing I didn't like about the book was
that the Printers collection available in VB is not available in
earlier versions of VBA :-(.

James A. Fortune
Nov 13 '05 #4

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

Similar topics

6
by: Lapchien | last post by:
One of my users has asked that a form change it's colour if a particular yes/no box is ticked - possibly made a bit more tricky because the form is tabular..? Thanks, Lap
2
by: Scott | last post by:
Is it possible to have a button change colour OnClick ? Thanks.
2
by: James Dean | last post by:
I create a bitmap like this. The width and height are got from the compressed file i am reading. The width and height are in pixels.....1bpp bitmap = new...
2
by: Carl Gilbert | last post by:
Hi I am looking to edit an icon at runtime on menu items such as change fill colour. I wish to replicate the features found in most applications where by the coloured bar on a colour picker...
11
by: Tim Marshall | last post by:
I use Terry Kreft's & Stephen Lebans colour dialog procedures for users to pick colours for various control properties in certain apps. Is there a way to take the colour code that is displayed in...
3
by: Mark Ingram | last post by:
Hi, ive got an imagine in a PictureBox, and would like to get the colour of the pixel when the mouse is over the control. From what ive (briefly) seen, there is no way to do this directly in C# and...
2
by: John Pote | last post by:
Hello, I am new to CSS and come from an embedded/electronics background. Could some help with a question on colours and palettes using named colours rather than hex values (ie color: #aabbcc)....
3
by: Samuel | last post by:
Can anyone advice how to set the background colour of a new Bitmap Thank you, Samuel
6
Robbie
by: Robbie | last post by:
Hi. I've made 2 functions which play around with colours. They convert a 'colour number' (I don't know what the proper name for it is, so I call it this - the Long given back by RGB(),...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.