CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Other Machines > Printing, Scanners, Vinyl cutting and Plotters


Printing, Scanners, Vinyl cutting and Plotters Discuss Printers, Scanners, Vinyl cutting machine and Plotting questions here.


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 04-02-2004, 08:01 PM
 
Join Date: Mar 2004
Location: United States
Posts: 1,147
vacpress is on a distinguished road
How does process color work

Anyone here allready know anything about writing printer drivers...

or at least, writing a program that can break an image into a grid and put a color value in each space of the grid, and then process that info into a long file of coordinates and color pixels?
__________________
Design & Development
My Portfolio: www.robertguyser.com | CAD Blog I Contribute to: http://www.jeffcad.info
Tweet this Post!Share on Facebook
Reply With Quote

  #2   Ban this user!
Old 04-03-2004, 02:43 AM
 
Join Date: Jul 2003
Location: United States
Posts: 124
Chagrin is on a distinguished road

Code:
#!/usr/bin/perl

use GD;

my $image = GD::Image->new("whatever.jpg");

my ($width, $height) = $image->getBounds();
foreach $x (0..$width) {
  foreach $y (0..$height) {
    my($red, $green, $blue) = $image->rgb($image->getPixel($x, $y));

    print "color is $red $green $blue at $x $y\n";
  }
}
Hey, that's the easy part.
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 04-03-2004, 02:48 AM
 
Join Date: Mar 2004
Location: United States
Posts: 1,147
vacpress is on a distinguished road

Chagrin - please elaborate on this - did you look at the "4 color painthead" in the cnc gantry printer thread?
__________________
Design & Development
My Portfolio: www.robertguyser.com | CAD Blog I Contribute to: http://www.jeffcad.info
Tweet this Post!Share on Facebook
Reply With Quote

  #4   Ban this user!
Old 04-03-2004, 02:50 AM
 
Join Date: Mar 2004
Location: United States
Posts: 1,147
vacpress is on a distinguished road

so this code - can you repost it with comments?

i am looking at it. it.. opens a file, finds the files resolution, devides by that number and then finds the color value for each division. the it prints the data to the screen? tell me more! MORE. i was jsut this minute reading about ghostscript and thinking about a postscript vector based driver...
__________________
Design & Development
My Portfolio: www.robertguyser.com | CAD Blog I Contribute to: http://www.jeffcad.info
Tweet this Post!Share on Facebook
Reply With Quote

  #5   Ban this user!
Old 04-03-2004, 03:04 AM
 
Join Date: Mar 2004
Location: United States
Posts: 1,147
vacpress is on a distinguished road

here is somethign that may help with this problem.


"Printer Driver Block Diagram"

__________________
Design & Development
My Portfolio: www.robertguyser.com | CAD Blog I Contribute to: http://www.jeffcad.info
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 04-03-2004, 12:07 PM
 
Join Date: Jul 2003
Location: United States
Posts: 124
Chagrin is on a distinguished road

Aw geez, "four color painthead"... now you want me to convert it to CMYK. I'm trying to answer one question at a time

OK, back from the beginning, yes you did get the basic flow of the program right -- it's moving pixel by pixel in the image and printing the RGB values of that pixel. I don't see any need to copy all that data into a "grid" as you mentioned earlier since that can all be done on the fly as the hardware moves. I was just trying to demonstrate how you can walk through an image and look at those pixel values.

I saw in another thread that someone recommended ghostscript, and this really isn't the way to go. Ghostscript is mainly used when the hardware speaks the standard language of Postscript, which nearly all printers do, but that's completely out of scope for us. Similarly, using vector-based printing (like a plotter) as opposed to raster-based printing (like every other printer) would add massive levels of complexity to the problem. I can't even begin to ponder all of the algorithms used to find the path for the printhead and routines necessary to draw something as simple as an arc, much less optimizing either. "floodfills" are completely out of the question. Leave that stuff to the professionals
Tweet this Post!Share on Facebook
Reply With Quote

  #7   Ban this user!
Old 04-03-2004, 01:11 PM
 
Join Date: Mar 2004
Location: belgium
Posts: 42
publitime is on a distinguished road

i use a program for doing signmaking.
In the program there is a proffesional RIP.
For all large format printers there is a driver in the program.
Maeby that will be usefull.
I will post the question on a german cnc forum.
Maybe i can find there somebody who can write a printerdriver.
Tweet this Post!Share on Facebook
Reply With Quote

  #8   Ban this user!
Old 04-03-2004, 01:59 PM
 
Join Date: Mar 2004
Location: United States
Posts: 1,147
vacpress is on a distinguished road

chagrin - thanks for the reply!

it seems i have 2 choices - either trying to try and use a mix of regular plotter CNC software with 4-color seperations run into a "raster to vector" convertor

or to write my own raster based software. this is preferable because it will be fun. if the program starts in the uper left corner of the image and reads to the right, it can scan the image as the painthead reproduces the dots..

how would i just use a .bmp? is there a good source of info on this type of coding?

- what is that provess called in the code you wrote, where can i learn more about it? is there a way to use it with CMYK values instead of RGB?

i can iamgine easily getting the thing to move (x)steps to the left for each pixel, and (x) step forward to advance to he next line, then seeing what color is in that cell, and sending the command to a program in a PICmicro that mixes the paint and produces the dot, send a "go forward" command and then it does it again.


thanks....
__________________
Design & Development
My Portfolio: www.robertguyser.com | CAD Blog I Contribute to: http://www.jeffcad.info
Tweet this Post!Share on Facebook
Reply With Quote

  #9   Ban this user!
Old 04-03-2004, 02:05 PM
 
Join Date: Mar 2004
Location: United States
Posts: 1,147
vacpress is on a distinguished road

publitime- i am trying to find a forum where people are working on these issues. i know there are at least 2 places to look but havent found any. I am looking for:

1-people who are involved in image editing software that would understand how to process a file into coordinates and color values.

2-people who are involved in writing general hardware or printer drivers...

HPGl, HP RTL are both acronyms that seem usefull to look at.


does the information at:
http://www.ghostscript.com/doc/gnu/...es.htm#Uniprint

help or confuse things?
anyone?
__________________
Design & Development
My Portfolio: www.robertguyser.com | CAD Blog I Contribute to: http://www.jeffcad.info

Last edited by vacpress; 04-03-2004 at 02:17 PM.
Tweet this Post!Share on Facebook
Reply With Quote

  #10   Ban this user!
Old 04-03-2004, 03:33 PM
 
Join Date: Mar 2004
Location: belgium
Posts: 42
publitime is on a distinguished road

vacpress

I'm also searching the net to find a way to write a driver.
What will be the best program for you to write a driver
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 04-03-2004, 04:09 PM
 
Join Date: Mar 2004
Location: belgium
Posts: 42
publitime is on a distinguished road

vac

Take a look at
http://www.noobeed.com/
There can be something intressting
Tweet this Post!Share on Facebook
Reply With Quote

  #12   Ban this user!
Old 04-03-2004, 07:01 PM
 
Join Date: Jul 2003
Location: United States
Posts: 124
Chagrin is on a distinguished road

You don't really want to get into the business of decoding image file formats directly. Even bitmaps have numerous headers and compression stuff you'd need to wade through before you could even begin to make heads and tails of the pixels in the image. The "GD" library is an excellent place to start to avoid all that stuff, as I did in my example.

I barely know anything about printing processes, but I do know it's possible to convert RGB to CMYK. It's something on the order of:
Code:
    $C = 1 - ( $red / 255 );
    $M = 1 - ( $green / 255 );
    $Y = 1 - ( $blue / 255 );

    my $K = 1;

    $K = $C if ($C < $K);
    $K = $M if ($M < $K);
    $K = $Y if ($Y < $K);

    $C = ($C - $K) / (1 - $K);
    $M = ($M - $K) / (1 - $K);
    $Y = ($Y - $K) / (1 - $K);
...but I think I have my intensities inverted. Inevitably there will be a lot of tweaking to get the colors looking right.
Tweet this Post!Share on Facebook
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Second machine design process yukonho CNC Wood Router Project Log 134 03-28-2007 11:07 AM
Homemade PCB 'fit and finish' shadow General Electronics Discussion 9 02-05-2005 07:01 PM
Too Good To Be True? boss1 OneCNC 14 08-01-2003 01:55 AM
What kind of process controls does MC have? HuFlungDung Mastercam 3 05-28-2003 11:31 PM
Render views in process? SRT OneCNC 6 05-25-2003 01:23 PM




All times are GMT -5. The time now is 10:54 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353