Closed Bug 45793 Opened 24 years ago Closed 23 years ago

[FIX] Print/Greyscale prints colored text/background

Categories

(Core :: Printing: Output, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED FIXED
mozilla0.9.3

People

(Reporter: h.b.furuseth, Assigned: dcone)

References

()

Details

(Keywords: helpwanted)

Attachments

(2 files)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; SunOS 5.7 sun4u; en-US; m16) Gecko/20000621
BuildID:    2000062115

Print with Greyscale prints text and background in color.
Images are properly grey, but may be surrounded with
lines of background color.

Reproducible: Always
Steps to Reproduce:
1. Fetch http://www.uio.no/~hbf/mbug2.html .
2. Choose File/Print, click on Greyscale.
3. Print to a color printer or to a file, and view the
results.

Actual Results:  Red text.  Green background in the DIV boxes.

Images are grey as they should, but Ghostview first
draws a green background for them, and this may leave
green lines next to the images.

Expected Results:  Black text. Grey or white background in the DIV boxes.
No green lines next to the images.

(This URL also demonstrates another (reported) bug.)
Severity: normal → minor
setting bug status to New
Status: UNCONFIRMED → NEW
Ever confirmed: true
This bug has been marked "future" because the original netscape engineer working
on this is over-burdened. If you feel this is an error, that you or another
known resource will be working on this bug,or if it blocks your work in some way
-- please attach your concern to the bug for reconsideration.
Status: NEW → ASSIGNED
Target Milestone: --- → Future
This is also a problem in the Linux builds.  I've noticed it as recently as the
11/27 build.
spam : changing qa to sujay (new qa contact for Printing)
QA Contact: shrir → sujay
Blocks: 64841
Target Milestone: Future → mozilla0.9.1
Keywords: helpwanted
OS: Solaris → Linux
Hardware: Sun → PC
Target Milestone: mozilla0.9.1 → mozilla0.9.3
*** Bug 78368 has been marked as a duplicate of this bug. ***
I just attached a patch to allow for greyscale printing on Unix - it was 
a pretty simple fix.  Could the appropriate parties take a look at it?

Thanks.
I will get the review and sr and check in if you want.  I looked at the patch.. 
it looks great.  Thanks
dcone,

It would be great if you could review the patch.  Could you also set the
appropriate Keywords - patch and review I guess. I don't have the necessary
permissions.

Thanks.
(Sorry about all of the email).

Oops, I should have checked the patch on more examples.  Turns out it only
half fixes the problem.  Color must be set somewhere else as well in the 
code.  I'll try to track that down and fix the patch next week. 
The attachment above says:
    For greyscale postscript, find the average brightness of red, green,
    and blue.
Unless the code does some magic I haven't noticed, the values should be
weighted by the human eye's sensitivity to these colours.  According to
http://userpages.umbc.edu/~schmitt/331F96/cmould1/paper.html and the old
FBM library (http://ftp.uu.net/graphics/fbm.tar.Z), the NTSC values are
    29.9% * Red + 58.7% * Green + 11.4% * Blue.

Libraries seem to allow these values to be overridden, though.  Maybe
Mozilla should too.  And then one could always add contrast enhancement
and edge detection and... oh my, I had no idea this was so complex.
Actually.. and average is a good conversion to greyscale.   There are very 
complex thing you could do.. like some color cards give green 6 bit and red 
and blue have 5 each in 16 bit mode because the eye is more sensitive to 
green... but for this bug.. average is just fine based on my observations of 
software I wrote in the past that dealt with these exact issues.  Very observent 
though.. I was wondering if anyone would bring that up. 
It looks like my original patch does work OK.  I was testing with an unpatched
version :) .

And as for color weighting, whatever others decide is fine with me.  I'm
certainly no expert - I didn't do any research on what proper formula would be.
Could you put up your patch.. but use the -u switch.  I will take care of the 
rest.  
Attached patch Patch in -u form (deleted) — Splinter Review
r=dcone
sr=attinasi
So are we just waiting for someone to a= on this bug?  Anyone in
particular who should be contacted?
Summary: Print/Greyscale prints colored text/background → [FIX] Print/Greyscale prints colored text/background
a= asa@mozilla.org for checkin to the trunk.
(on behalf of drivers)
Blocks: 83989
Fixed
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Hallvard,

IS this fixed for you now? please try in latest build...let me know...thanks.
marking verified....if anyone disagrees REOPEN...
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: