LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 09-29-2013, 08:47 PM   #1
GreyBeard
LQ Newbie
 
Registered: Oct 2003
Location: Taxachusetts, USA
Distribution: Slackware
Posts: 25

Rep: Reputation: 0
How do I print a million dots on a single sheet of 8.5x11 paper?


Hi,

I have something I want to print which is a little off the beaten path,
so to speak. I know next to nothing about printing so I need help. I
am doing this for educational purposes to TRY to get across the concept
of large numbers to elementary school kids.

I want to put exactly one million VISIBLE, distinct dots on one 8.5 x 11
sheet of paper, plus be able to put some comments on the sides, top, or
bottom, and perhaps highlight a few of the dots with color around them
instead of white. I realize that the dots will be quite small. It
would also be nice if the page could be reproduced on a copier tho that
is not a requirement.

I have the following equipment and software: I run 32-bit Linux. I have
a variety of programs which go with my Linux (latest Slackware) such as
EMACS for (maybe?) creating repetitive printer commands and GIMP for
creating and editing images. My printer is an OKI C5300 color laser
printer which, as I understand it, can print emulating Postscript 3 and
PCL 5c. It has a resolution of 600 DPI.

I think I would prefer a rectangular grid like this where * is a dot and
_ is white or light color

_________
_*_*_*_*_
_________
_*_*_*_*_
_________
_*_*_*_*_
_________

which would be more distinct, I think, than a chessboard pattern like this

__________
_*_*_*_*__
__*_*_*_*_
_*_*_*_*__
__*_*_*_*_
_*_*_*_*__
__*_*_*_*_
__________

but a chessboard pattern would be better for improved density. Being able
to try both would be good because you really can't tell how it looks until
you actually see it.

Assuming that I can control each and every printer dot and that I can
print 7.5x10 inches, then I have room for 7.5x10x600x600 == 27,000,000
printer dots on the page. Since I want a million visible dots on a
square grid that means that each visible dot can be
int( sqrt( 27000000 / 1000000 )) == 5 printer dots on each side. Thus
each visible dot would look like the following in printer dots:

_____
_***_ This would allow for 16/25 white and 9/25 black, and there
_***_ would be two rows of white vertically and horizontally
_***_ between each visible dot.
_____

OR
_____
__**_ This would have much more separation between the visible dots
__**_ but the visible, 4/25 black part of the dot would be much
_____ smaller. It's hard to tell whether this or the above would
_____ be more visible when actually on paper.

The above are for the rectangular layout. A checkerboard layout would
alternate cells with visible dots with empty cells, thus giving me 1/2
the visible dot density. Thus my rectangles would be reduced to 3x3.
In order to separate dots at the corners I would have to use something
like one of the following patterns:

_*_
***
_*_

OR

***
***
_*_

Both would give more ink per visible dot than the 4/25 black pattern
above but with much more separation between dots.

Again it's hard to say which of the 4 schemes above would look the best
until I actually see it on paper.

I see three ways of doing these 4 schemes: (1) Issue lots of nearly
repetitive printer commands. (2) Build a glyph with 10x10 visible dots
in it which uses up the entire character cell space and aligns the dots
properly on each side and above and below, and then just print 10,000 of
them in a rectangle which fits on 8.5x11 paper where the last row does
not have to be the size of the other rows. (3) Make an uncompressed,
high resolution image of 1,000,000 dots and just print it, but would
there be problems in translation from image to printer?

I have another question: Assuming again that I can access each printer
dot, can I also control the size of that dot (within reason)?


That's kind of the limit of what I currently can guess for this project.
All useful hints, ideas, suggestions, etc, will be appreciated. Please
reply via this website or via the eMail address I set up for this
project: Jeff.B.million_dots@myLetters.US Also if you know of another
forum where I could ask this question please let me know about it.


Thank you in advance,
Jeff B.

Jeff.B.million_dots@myLetters.US
 
Old 09-29-2013, 09:34 PM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,494

Rep: Reputation: 437Reputation: 437Reputation: 437Reputation: 437Reputation: 437
I'd probably just build the image using Gimp and print that.
 
Old 09-29-2013, 09:42 PM   #3
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 1,852

Rep: Reputation: 626Reputation: 626Reputation: 626Reputation: 626Reputation: 626Reputation: 626
I agree with Mr. Cranium, just build up the grid using the Gimp, repeat it as necessary then print.

You might build a few 1x1 inch grids with different size dots to see what gives the best visual results.
 
Old 09-30-2013, 04:16 AM   #4
mancha
Member
 
Registered: Aug 2012
Posts: 290

Rep: Reputation: Disabled
Given you want to annotate, let's put 1/2 inch borders on all 4 sides. This gives an effective printable area of 7.5" x 10".

At 600 DPI we have at our disposal 27,000,000 total dots. It might be too much to expect one to see a 1x1 "dot", so lets make
them 2x2 squares and put them 3 dots apart from their neighbors. This means each "dot" requires a space of 5x5.

We can plot roughly 1,080,000 (just above our 1 million requirement) "dots".

So, we are going to settle on a rectangular grid with 900 "dots" across and 1112 "dots" down. The last row will only have
100 "dots" across not the full 900.

We will highlight about 1% of them by putting a red 1-dot-wide halo around them at regular intervals.

The image will look like this:


Code:
  OO...OO...OO...
  OO...OO...OO...
  ...............
  ...............
  ...............
  OO...OO...OO...
  OO...OO...OO...
  ...............
  ...............
  ...............
  OO...OO...OO...
  OO...OO...OO...
  ...............
  ...............
  ....++++.......
  OO..+OO+..OO...
  OO..+OO+..OO...
  ....++++.......
  ...............
  ...............
O=black
.=white
+=red

We can print it with something like this:

Code:
$ lp -d $printername -o media=letter -o scaling=100 -o page-top=36 \
  -o page-bottom=36 -o page-left=36 -o page-right=36 million.png

--mancha


PS If I got my math right, this image has exactly 1,000,000 "dots". I tried counting them but kept losing track around 700,000.
Attached Images
File Type: png million-dots.png (30.3 KB, 125 views)
 
Old 09-30-2013, 08:40 AM   #5
Habitual
Senior Member
 
Registered: Jan 2011
Distribution: Undecided
Posts: 3,314
Blog Entries: 5

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Quote:
Originally Posted by mancha View Post
I tried counting them but kept losing track around 700,000.
Smart and Funny
 
Old 09-30-2013, 09:10 AM   #6
mancha
Member
 
Registered: Aug 2012
Posts: 290

Rep: Reputation: Disabled
Pesky off-by-one error...my first image had 1,000,001 "dots". This one should be good.
Attached Images
File Type: png million-dots-1.png (30.3 KB, 55 views)
 
Old 09-30-2013, 09:19 AM   #7
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Rep: Reputation: 115Reputation: 115
I would think 1,000,001 meets the requirement of a million.
 
Old 09-30-2013, 10:32 AM   #8
mjolnir
Member
 
Registered: Apr 2003
Posts: 665

Rep: Reputation: 68
@mancha Great work. Now if you can just get this paper to work with my LiveScribe Echo smartpen in Linux I'd be a happy camper. ;-)
 
Old 10-01-2013, 02:11 AM   #9
emgee_1
Member
 
Registered: Aug 2009
Location: Nijmegen, The Netherlands
Distribution: Slackware 14
Posts: 40

Rep: Reputation: 6
I did not try this yet but how about :

plotting random using R and ggplot2 points with the x and y coordinate from say the interval (0,1) .
Using the capabilities of ggplot2 you can then make every 1000th point a little bigger or different color.

As a side note : if you use NSA random generator you get
the the Snowden: Most Wanted picture

I will try a little later to produce something like that

Greetings

Marcel
 
Old 10-01-2013, 04:43 PM   #10
GreyBeard
LQ Newbie
 
Registered: Oct 2003
Location: Taxachusetts, USA
Distribution: Slackware
Posts: 25

Original Poster
Rep: Reputation: 0
Mancha,

Hi. And thank you. I was less successful than you at counting
the dots. I couldn't find even one to count when I printed the
page, even with a magnifying glass. It just looked grey.

I don't understand how those .PNG image files you attached
actually work. They are quite small, so either .PNG files have
some sort of built-in replication (I know nothing about how .PNG
files work either.) or I don't understand what the LP command is
doing, especially that -o scaling=100 option. Is that just
telling it to print at 100% of the size or is it scaling it up
by a factor of 100?


Thanks,
Jeff B.

Jeff.B.million_dots@myLetters.US
 
Old 10-01-2013, 08:10 PM   #11
qweasd
Member
 
Registered: May 2010
Posts: 439

Rep: Reputation: Disabled
better compression

May be you find this useful. Save as dots.ps, then
Code:
ps2pdf dots.ps
then cross your fingers and print. Play around with v_dot_size. As given,
this prints into resolvable dots on my 600 dpi laser. Resolvable with a 20x lens.
Unless your eyes are much better than mine, you may be asking for too much if
you want to see individual dots.

Code:
%!PS
%%BoundingBox: 0 0 612.0 792.0

% Ivan Zaigralin a.k.a. Melikamp.
% Copyright (C) 2013.  Licensed under GNU GPL version 3 or later,
% as published by FSF.

% I draw a rectangular grid of dots on the bottom of a letter-sized
% page. All lengths in points, 1 point = 1/72 inch

/v_dot_size 0.05 def % a dot is a square with side this long
/v_dot_x 1000 def % number of dots in row
/v_dot_y 1000 def % number of dots in column
/v_margin 32 def % margin around the dot field

% distance between dot centers is as large as page width and dot size
% allow
/v_dot_spread
    8.5 72 mul % letter width
    v_margin 2 mul sub v_dot_size sub % - 2*margin - dot size
    v_dot_x 1 sub div % over (# of dots - 1)
def

% init
0 setlinewidth
v_margin v_margin translate

/f_draw_dot { % draw dot here
    gsave newpath
	0 0 moveto
	v_dot_size 0 rlineto
	90 rotate
	v_dot_size 0 rlineto
	90 rotate
	v_dot_size 0 rlineto
    closepath fill grestore
} def

% let's draw already!

v_dot_y {
    gsave
	v_dot_x {
	    f_draw_dot
	    v_dot_spread 0 translate
	} repeat
    grestore
    0 v_dot_spread translate
} repeat

showpage

Last edited by qweasd; 10-01-2013 at 08:30 PM.
 
Old 10-02-2013, 06:51 PM   #12
mancha
Member
 
Registered: Aug 2012
Posts: 290

Rep: Reputation: Disabled
@qweasd:

I really enjoyed this approach!

One suggestion I have is to use 800x1250 dots (rather than 1000x1000) to make better use of the paper's real estate (see below):

Code:
%!PS
%%BoundingBox: 0 0 612.0 792.0

% Ivan Zaigralin a.k.a. Melikamp.
% Copyright (C) 2013.  Licensed under GNU GPL version 3 or later,
% as published by FSF.

% I draw a rectangular grid of dots on the bottom of a letter-sized
% page. All lengths in points, 1 point = 1/72 inch

/v_dot_size 0.05 def % a dot is a square with side this long
/v_dot_x 800 def % number of dots in row
/v_dot_y 1250 def % number of dots in column
/v_margin 32 def % margin around the dot field

% horizontal distance between dot centers is as large as page width
% and dot size allow
/v_dot_spread_x
    8.5 72 mul % letter width
    v_margin 2 mul sub v_dot_size sub % - 2*margin - dot size
    v_dot_x 1 sub div % over (# of dots - 1)
def

% vertical distance between dot centers is as large as page length
% and dot size allow
/v_dot_spread_y
    11 72 mul % letter length
    v_margin 2 mul sub v_dot_size sub % - 2*margin - dot size
    v_dot_y 1 sub div % over (# of dots - 1)
def

% init
0 setlinewidth
v_margin v_margin translate

/f_draw_dot { % draw dot here
    gsave newpath
	0 0 moveto
	v_dot_size 0 rlineto
	90 rotate
	v_dot_size 0 rlineto
	90 rotate
	v_dot_size 0 rlineto
    closepath fill grestore
} def

% let's draw already!

v_dot_y {
    gsave
	v_dot_x {
	    f_draw_dot
	    v_dot_spread_x 0 translate
	} repeat
    grestore
    0 v_dot_spread_y translate
} repeat

showpage
Also, with the variant below of the main loop, 1% of the dots will be red (not black). Note, this'll likely take a lot longer to print since it calls a prng 10^6 times.

Code:
v_dot_y {
    gsave
        v_dot_x {
            rand 21474836 lt {
              1 0 0 setrgbcolor
            } {
              0 0 0 setrgbcolor
            } ifelse
            f_draw_dot
            v_dot_spread_x 0 translate
        } repeat
    grestore
    0 v_dot_spread_y translate
} repeat
@Greybeard:

About PNG, it achieves the small file size by using loss-less compression. This is in contrast to other formats such as JPEG which use lossy compression.

If you use qweasd's solution, which I think you should, and you have a network printer, you can send the postscript file directly:

Code:
$ nc -q 2 my.printer.here 9100 < million.ps
--mancha
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I print a million dots on a single sheet of 8.5x11 paper? GreyBeard Linux - Hardware 1 09-29-2013 09:43 PM
( Excel::Writer::XLSX->new) question: how to open single sheet by name PoleStar Linux - Newbie 3 05-01-2013 05:21 AM
How to print several photos on the same sheet with GIMP earlsheridan Linux - Software 5 03-28-2011 03:42 PM
Hi, I am a white sheet of paper! jccjoanne LinuxQuestions.org Member Intro 5 03-17-2010 11:32 PM
print questions --- multi pages in single paper fhleung Debian 1 03-17-2008 05:08 AM


All times are GMT -5. The time now is 02:55 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration