IRC Logs

Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2015/03/03)20150304 
henrys mvrhel_laptop: how's the skiing?03:50.12 
AjayK hello. I had a query related to my yesterday's query. My query was to achieve similar results from Ghostscript as produced by Informatik. I am using Informatik Image Driver x64. I open a PDF in Adobe PDF and Print it using this printer. In the settings for Informatik, Format = "B/W Group4 1-Strip". There is also an option for Halftone Color adjustment. any help?09:58.55 
chrisl AjayK: No. "B/W Group 4....." is just the compression setting. The "Halfton Color adjustment" would only, maybe, be helpful if we knew what it was actually adjusting10:03.49 
  AjayK: the likelihood is you're going be into custom ICC color profiles and/or custom threshold arrays, or other halftone customisations to get where you want to be. Based on what you said, there is a *strong* chance that the Informatik thing is color managing "almost black" to "solid black" - that is possible with Ghostscript, by using a customised ICC profile10:07.18 
  AjayK: Actually, thinking about it, you might be able to get closer to what you want by applying a transfer function.....10:17.28 
  AjayK: so, possibly adding something like: -c "{dup 0.15 lt {pop 0.0} if} settransfer" -f <input.pdf> to your command line *may* get you closer (you might have to fiddle with the "0.15" tint value)10:27.54 
AjayK should I use it like this?10:29.48 
  gswin32c -dSAFER -dNumRenderingThreads=2 -dUseCropBox -dNOPAUSE -sDEVICE=tiffg3 -dBATCH -c "{dup 0.15 lt {pop 0.0} if} settransfer" -f -r300 -sOutputFile=output\%04d.tif D21901.PDF10:29.49 
chrisl No, the "-c .... -f" must immediately precede the input file10:31.17 
  so gswin32c -dSAFER -dNumRenderingThreads=2 -dUseCropBox -dNOPAUSE -sDEVICE=tiffg3 -dBATCH -r300 -sOutputFile=output\%04d.tif -c "{dup 0.15 lt {pop 0.0} if} settransfer" -f D21901.PDF10:31.49 
AjayK got it.10:32.14 
  ok so I think the results are getting similar now.10:32.30 
  btw, these are the Halftone settings: http://s18.postimg.org/8z9r1a2hl/Halftone.jpg10:32.53 
chrisl Hmm, I don't actually see *any* halftone settings there, only color ones10:34.18 
  FWIW, if your input is supposed to be *pure* black and white (no greys at all), we could tweak the transfer function further to enforce that10:35.43 
AjayK well we do now know if the input will be colored or grayscale or black and white10:37.40 
  do not*10:37.44 
chrisl Well, as I keep saying, the only way we could attempt to match the Informatik output with any confidence, under most/all circumstances would be to know exactly what Informatik is doing. So far, we don't even know what type of halftone dithering Informatik is doing10:39.58 
  Then there is color management, where it may well be doing different things depending on the color space in force and/or the object type being rendered.10:40.51 
AjayK hmmm. i think with the above command u mentioned "-c .... -f", ghostscript works as per requirement10:43.42 
  i will use this only and alter the 0.15 and set it to a value which suits most10:44.03 
Robin_Watts AjayK: One possible alternative way to work...10:44.03 
  Get gs to write out a .pgm file10:44.37 
chrisl AjayK: You may find it has unexpected side effects with other documents, though, especially color ones10:44.37 
Robin_Watts Then scan through the pgm file looking for the max and min pixel values.10:44.52 
  Then expand the range so that max -> 255 and min -> 010:45.12 
  But as chrisl says, that may give unexpected results with other documents.10:45.39 
AjayK +chrisl: i know there are side effects specially when pdf contains some scanned diagrams or graphs. and i will only be using this switch in case of B/W output. for color i wont use this switch10:46.36 
  +Robin_Watts: could you explain the point "Expand the range so that max -> 255 and min -> 0"? 10:47.20 
Robin_Watts AjayK: Well, suppose you find that every pixel lines between 16 and 240.10:47.43 
  That would mean that black is dark grey and white is light grey.10:48.01 
chrisl AjayK: there is the option to make the transfer function smarter, or to set separate transfer functions for each colorant. But we'd need to know the parameters involved to write that10:48.33 
Robin_Watts So, you expand the range: i.e for each input value x, replace it with (x - 16) * 255 / (240-16)10:48.44 
  That would ensure that the darkest thing on the page really is black, and the lightest is white.10:49.14 
AjayK and how would i cater that in the gs command? i mean which variable value would have to be changed? the 0.15?10:49.21 
Robin_Watts It's basically doing the transfer function after the entire thing has been rendered.10:49.42 
  AIUI, what chrisl's transfer function does is to say: "If the ink value < 0.15 then actually use black"10:50.40 
  So it'll screw up gradual fades to black.10:51.08 
chrisl Yep, exactly that. So, we could also force values for white.....10:51.27 
Robin_Watts whereas what I propose keeps gradients as gradients.10:51.32 
chrisl Robin_Watts: on a halftoned device, gradual fades are pretty screwed anyway!10:51.48 
Robin_Watts Not that badly :)10:52.04 
  chrisl: Presumably we could do something like: { 0.15 sub 0.7 div } settransfer ?10:53.38 
  That'd map anything in the bottom 15% to black and anything in the top 15% to white ?10:54.04 
  (or do we need some clamping in there too?)10:54.16 
chrisl Robin_Watts: yeh, that's what I mean - we can make the transfer function much smarter, *if* we know what we need to achieve. Clamping would be wise in case of rounding errors10:54.51 
  Then, if we start looking at custom ICC profiles, you can apply a specific profile to a specific object type..... not sure what we classify gradient fills as, but I'd hope it would be "image"10:56.20 
  But customised ICC profiles are well beyond my knowledge......10:57.51 
  Oh, another thing you could do is have the transfer function only take action for specific color spaces - so it could be written to leave RGB and CMYK alone, and only adjust DeviceGray values11:00.49 
  Or use setcolortransfer to set a function per (standard) colorant, so it could be setup to leave RGB/CMY values alone, and only adjust K/Gray values......11:02.57 
  I have to do some shopping - bbiaw.....11:06.03 
AjayK hmmmm I see... 11:07.32 
  +Robin_Watts: how do I run this command on gs? { 0.15 sub 0.7 div } settransfer11:10.22 
  actually i figured it out11:13.26 
  I have tested a few combinations and I have observed the following: in case of text, when I use Informatik, the words are very clear meaning there are no pixels around a alphabet where as with ghostscript, there appears some pixels surrounding the alphabets11:18.57 
  http://s24.postimg.org/pdiq8pj0l/text.jpg11:21.03 
  the left image is created using ghost script "gswin32c -dSAFER -dNumRenderingThreads=2 -dUseCropBox -dNOPAUSE -sDEVICE=tiffg4 -dBATCH -r900 -sOutputFile=output\%04d.tif -c "{dup 0.15 lt {pop 0.0} if} settransfer" -f D21901.PDF"11:21.39 
  the right image is created using informatik11:21.47 
Robin_Watts Ahak: So, tweak the transfer function.11:28.29 
  0.2 sub 0.6 div for instance.11:28.41 
AjayK you mean i should use this: "gswin32c -dSAFER -dNumRenderingThreads=2 -dUseCropBox -dNOPAUSE -sDEVICE=tiffg4 -dBATCH -r300 -sOutputFile=output\%04d.tif -c "{ 0.2 sub 0.6 div } settransfer" -f D21901.PDF" ?12:07.35 
chrisl AjayK: that's what Robin_Watts meant, yes. But really, it's down to you to experiment with the numbers12:11.11 
  AjayK: obviously, the closer to 0.0 you can make the adjustment happen, the fewer unwanted side effects (like the shadings) you'll encounter.12:13.56 
AjayK hmm. well thanks a lot +chrisl and +Robin_Watts :)12:16.32 
Robin_Watts chrisl: Checkin time.12:23.43 
  chrisl: You might want to consider 21F.12:23.54 
  or not. Helen and I are in 21D and E.12:29.21 
  If the flight is full, it's a win to be sitting next to someone that's not smelly etc, but if the flight is moderately empty, you lose the chance at a seat being free next to you.12:30.16 
chrisl Er, you are assuming I'm not smelly etc.....12:30.43 
Robin_Watts chrisl: indeed.12:31.35 
  or you might choose that you'd rather not sit next to Helen. I'd understand that completely :)12:32.07 
chrisl I have new, rather effective noise cancelling headphones, so......... ;-)12:32.58 
  Robin_Watts: did you say we had to bring driving licenses for the snowmobiling?12:36.22 
Robin_Watts Yes.12:36.43 
  both parts (though they tend to be happy with just the plastic bit)12:37.00 
chrisl Ah, good, that explains why I'd put it in with my passport, then!12:37.12 
Robin_Watts Currently, Helen and I are down as the drivers for the car. We can put more people on if they want.12:37.26 
chrisl It's up to you two - if you want to share the driving more. I'm happy not driving.....12:38.35 
Robin_Watts chrisl: I'm happy to do the driving. Helen is on there in case I get a migraine or something, so we're covered.12:41.04 
henrys Robin_Watts: the road up and down from rocky mountain national park is a winding mountain road that makes some folks nervous. We can split up people in your car and mine and Sabrina and I could be the drivers. But some people are more nervous being the passenger on those roads ;-)14:55.52 
Robin_Watts henrys: I'm happy driving.15:05.16 
  and I'm not sure how insurance works out...15:05.29 
  I thought Sabrina would be at her show?15:05.45 
henrys Robin_Watts: she'll just miss saturday. I thought the plan was to go up Sunday.15:07.17 
  Robin_Watts, paulgardiner, chrisl : if you guys have any specific requests for Saturday after the meeting let me know. I had a few ideas of things to do in Longmont, but if you want something more exciting - like Denver or Boulder we can do that too.15:13.51 
paulgardiner henrys: all sounds good to me.15:17.17 
chrisl Right now, anything that doesn't involve me hanging on the phone to a credit card company is very fine by me :-(15:19.22 
henrys sabrina's going to shovel the snow for the first time this year, I have to take pictures.15:23.22 
paulgardiner If she can wait until Sat, we could watch.15:37.45 
henrys paulgardiner: she'd like that ;-)15:39.00 
Robin_Watts henrys: ah, I thought that she was going to be at her show on sunday too.15:42.36 
  But if she's coming with us, great!15:42.43 
henrys February was the snowiest month in history for Denver and surrounding areas - not including the mountains ...15:42.44 
Robin_Watts The pdf_name and pdf_obj reworks get the peak memory use for bug 695761 down from 25.7 to 17.9Meg15:45.33 
henrys Robin_Watts: have you worked with fred on any of his mupdf bugs?15:50.22 
Robin_Watts not yet. He logged in briefly yesterday but didn't say anything.15:51.03 
  Did you pass on the bugs we talked about in the mupdf bugs list?15:53.41 
henrys Robin_Watts: yes I did15:54.20 
Robin_Watts OK. I'll drop him an email to invite him to ask questions etc.15:54.41 
henrys Robin_Watts: sure, he was fairly proactive with gsview so I suspect he'll be stopping by soon.15:56.19 
  chrisl: so the current font load for the PCL TT's is about 5.5 MG vs. 1.5 UFST FCO's. The otf's will help a lot but won't get us to UFST levels.16:00.06 
  s/levels/size16:00.36 
Robin_Watts henrys: Time for our own font format.16:00.48 
chrisl henrys: I don't see any way we can get down to UFST levels16:01.31 
henrys Robin_Watts, chrisl : I do think it would be an interesting project.16:02.37 
chrisl To get anywhere near that we'd have to not only have our own font format, we'd have to design our own fonts16:02.48 
  henrys: in our copious available time?16:03.18 
  FWIW, I think there are much better ways to spend time than faffing with fonts16:04.46 
henrys chrisl, Robin_Watts - I think there is enormous potential if you are willing to make minor quality sacrifices as well. We don't need separate box characters for every font - stuff like that.16:04.49 
  chrisl: arguably so but I think it's important we work on stimulating projects also, and not just chase revenue.16:05.36 
chrisl henrys: I doubt you'll save much space with things like that - those a very small glyph descriptions. You need to get into sharing features between glyphs, and that means designing our own outlines16:06.12 
Robin_Watts I've wondered before about doing glyphs as stroke fonts, but varying the width of the strokes between controlpoints.16:06.43 
chrisl And then we'll probably start to run into potential patent problems16:06.43 
henrys chrisl: yes, in fact otf already has a sharing mechanism - but I don't think it gets much use.16:07.00 
chrisl henrys: probably because most people focus on quality these days16:07.46 
Robin_Watts Render a given glyph as a high res bitmap, then 'evolve' a set of points/widths to best match.16:08.35 
henrys chrisl: I really should ask URW if they are hitting the "compression button" on whatever generates their fonts ;-)16:08.36 
chrisl henrys: FWIW, Type 1 and CFF also have the ability to share features between glyphs, but again, it's heavily dependent on the font designer to make use of them. I doubt, for example, that fontforge will auto-recognise similar curves, and pull them out for sharing16:09.41 
Robin_Watts henrys: Did you see the utils stuff from Raph in the Noto font stuff?16:09.48 
  https://code.google.com/p/noto/source/browse/third_party/fontcrunch/README.md16:10.12 
chrisl Robin_Watts: your approach would only really work for very simple outlines16:10.38 
Robin_Watts chrisl: Why?16:10.50 
henrys Robin_Watts: now I missed that wow cool, I was following his work on another compression front ... woff16:11.14 
chrisl Robin_Watts: how would you do a serif, for example? Without losing the efficiency advantage16:11.37 
Robin_Watts chrisl: Imagine we have a serif on the end of the top bar of an 'E' for example.16:12.24 
  You'd code the top bar of the E as being a stroke from the left to the start of the serif with a constant width.16:13.01 
  Then you'd have another control point just a bit further right, with a wider linewidth.16:13.26 
  henrys: There is scope that fontcrunch might run on .otf's.16:14.59 
  They are based on .ttf's after all.16:15.10 
chrisl My feeling is that the space saving wouldn't make it worthwhile - CFF charstrings are pretty compact16:15.12 
Robin_Watts chrisl: maybe.16:15.19 
henrys chrisl, Robin_Watts for us algorithmic bold and italic would have a huge impact but I've never seen it done well.16:15.53 
chrisl Robin_Watts: don't forget, we're not looking at TTF outlines, we're looking at CFF outlines16:15.57 
Robin_Watts chrisl: CFFs have quads or beziers?16:16.35 
  quads or cubics, rather ?16:16.47 
chrisl Beziers - PS imaging model16:16.48 
Robin_Watts OK. Raphs code converts quads to cubics.16:17.12 
henrys chrisl: I imagine his code could be worked over to support cff16:17.26 
Robin_Watts and he optimises cubics.16:17.40 
chrisl henrys: oblique is easy to "fake", italic is never going to work algorithmically16:17.42 
  I'm not sure what the freetype articial boldening is like, quality-wise16:18.19 
Robin_Watts so I'm assuming that he outputs cubics too... which would seem to imply he must produce CFF outlines?16:18.20 
chrisl I'd think so, since TTF, IIRC, doesn't do cubics16:18.50 
Robin_Watts so, I wouldn't be surprised to find that it worked on CFF input.16:19.53 
chrisl The other thing to take into account is that fontcrunch will definitely lose any TTF hinting16:23.56 
  Likely CFF hinting, too16:24.10 
  I just don't know how much time is worth spending to save a few k here and there, when the comparison with UFST means cutting the size by a factor of 3/3.516:27.01 
  Also, UFST is measurably slower - but I don't know that's to do with the implementation, or with the font format16:27.40 
henrys chrisl: with cff I think we'll be around double the ufst size.16:28.58 
chrisl henrys: converting the existing font for PCL to OTF, they come out at 12Mb... the TTF are 9.6mb16:34.04 
  Bare CFF comes to 5.1Mb16:35.48 
henrys chrisl: well courier otf (from urw not fontforge) is 64K the TT is 148K.16:38.21 
chrisl Obvously, I'm just going with fontforge, which clearly isn't the *best* output!16:39.01 
  Compressed: TTF=4.9Mb, OTF=5.6Mb and CFF=3.5Mb16:39.06 
henrys chrisl:yeah didn't look into why fontforge is so screwy16:39.58 
chrisl Probably whatever URW use to design the fonts can apply optimisations when converting from it's own format to the output, and the information to do that is lost at that point.16:42.16 
henrys chrisl: the situation is also complicated by rom compression - the tt's compress the otf's not so much.16:44.08 
chrisl henrys: well, obviously....16:44.40 
Robin_Watts Hi fredross-perry 17:43.59 
fredross-perry hi robin17:45.10 
  who is the best source of advice on building/debugging Android?17:46.10 
Robin_Watts fredross-perry: I've done it, so has paul.17:47.02 
  And pete.17:47.07 
fredross-perry Is using the emulator workable, or am I better off getting a device?17:47.38 
Robin_Watts I wrote the original Android app, and then paul reworked it. My JNI is still there, but the majority of the java stuff is his.17:47.45 
  A device is preferable.17:47.52 
  but be careful what device you pick :)17:48.03 
fredross-perry That’s what I thought. Recommendations?17:48.06 
Robin_Watts Some Android 4 devices (like the Samsung S3's) had trouble with debugging.17:48.31 
  I would be tempted to say get a proper Google device.17:48.47 
fredross-perry believe it or not, I hacked up my Nook Color to run Android. But it’s sooo slooooow17:48.56 
Robin_Watts There is a term for it... one where the firmware comes direct from google.17:49.07 
  fredross-perry: I have an old nook, and I had that running mupdf for a while.17:49.18 
  but the lack of multitouch is a pain.17:49.27 
fredross-perry indeed.17:49.41 
  What’s the minimum Android version we support?17:50.01 
Robin_Watts 2.3ish, iirc.17:50.38 
  maybe earlier.17:50.51 
  I got my mother in law a 2013 Nexus 7 and she loves it.17:51.23 
fredross-perry Is it easy to boot different Adroid versions on one device?17:51.31 
Robin_Watts That runs Android L I think.17:51.34 
  fredross-perry: hell no :)17:51.39 
fredross-perry Outstanding.17:51.49 
Robin_Watts or rather "it's easier than it is to boot multiple different versions of ios on the same device" :)17:52.47 
fredross-perry Fair enough. 17:53.20 
  I just decided we need a special character for Air Quotes (tm)17:54.04 
  So, more generally, how do we handle testing with different android versions and screen sizes?17:55.17 
Robin_Watts fredross-perry: testing.... I've heard of that....17:55.33 
fredross-perry *weeps openly*17:55.49 
Robin_Watts I have an LG G3, an HTC Desire HD, and an asus transformer tab.17:56.06 
fredross-perry OK17:56.17 
Robin_Watts I also have a Samsung S3 and my wife has a Samsung S4.17:56.21 
  Paul has an S2.17:56.25 
  Tor has a samsung tab.17:56.41 
  Joseph and Pete have every tab under the sun :)17:56.53 
  so between us we do OK.17:57.08 
chrisl And being open source, we a lot of voluntary "testers"......17:57.43 
  s/we/we get17:57.55 
Robin_Watts Michael and Miles have Nexus 10s.17:59.39 
  or maybe Paul has Miles' one now...17:59.56 
  There is something to be said for buying a device that the others of us don't have :)18:00.15 
  (I remember a computer company here that had a policy of never buying the same computer twice for that reason)18:00.41 
henrys I've heard the android studio has made a lot of performance improvements and ti allows configuring for multiple devices. Have you looked at that fredross-perry ?18:01.26 
Robin_Watts henrys: There are 3 schools of development on android; android studio, eclipse, and command line.18:02.04 
  the old command line stuff was based on ant.18:02.21 
  there is newer stuff based on gradle.18:02.30 
  (and I think android studio can drive either)18:02.39 
henrys Robin_Watts: maybe getting mupdf into the gradle world should be a priority18:03.09 
Robin_Watts The current mupdf android build system is ant based, but I believe eclipse can drive it without problems (as paulgardiner uses eclipse)18:03.30 
henrys Robin_Watts: eclipse is dead from what I've been reading folks are moving to studio.18:04.04 
Robin_Watts henrys: The sole reason for changing would be if what we change it to is better for people to embed into their own projects.18:04.45 
  I honestly have never looked at Android Studio or Gradle, so I can't speak to advantages.18:05.09 
  Chasing "this months latest best IDE" doesn't interest me.18:05.47 
  supporting the lowest common denominator out of the box does.18:06.04 
  and you can get to a working sdk/ndk install enough to build/develop mupdf without having to take the additional hit of installing/setting up an IDE currently.18:06.40 
fredross-perry I just got a used Nexus 7 on Amazon.18:06.44 
Robin_Watts fredross-perry: a 2013 one?18:06.52 
fredross-perry yes, 2013.18:06.59 
Robin_Watts cool. The older one doesn't run android 4.4, let alone 5.18:07.15 
  Now, last time I heard, android studio couldn't debug native code. Only java.18:07.45 
  Hence part of the reason I got VisualGDB.18:08.05 
  That route isn't open to fredross-perry as he's a mac user, I guess.18:08.31 
  ooh. Apparently VS2015 supports native code debugging on android.18:14.25 
henrys huh why would MS want to do that? is iOS support next?18:17.57 
Robin_Watts henrys: Gotta get developers developing on windows.18:20.31 
  otherwise there is no chance they'll develop *for* windows.18:20.46 
henrys Robin_Watts: watching the video now - simulator with a cordova project18:21.14 
  s/simulator/emulator18:21.47 
Robin_Watts VS2015 community edition is free for any non enterprise use.18:22.00 
  enterprise being "more than 250 developers" or more than "$2.5 million turnover".18:22.23 
  So that rules us out. So... how much does it cost to buy... can't see it for sale anywhere...18:22.54 
  I fear if they are giving it away to everyone else, they are really going to hike up the price for corporate purchasers.18:24.48 
henrys I have forgotten MS is a very different company than it used to be.18:26.10 
fredross-perry Speaking of Windows, does the Windows version of muPDF work well on MS tabs?18:35.13 
Robin_Watts fredross-perry: mvrhel is the guy to ask about that.18:40.17 
  he has a surface, I think.18:40.22 
fredross-perry hokay18:40.27 
Robin_Watts Actually, I'm sure it worked on a surface. I don't know if it worked on the phone.18:51.18 
  OK, for the logs... tor8/sebras: A few commits on robin/master to significantly reduce mupdf memory use.19:56.28 
  and seems to be about 9/241ths quicker in cluster testing.20:25.50 
fredross-perry that sounds like a Mr. Spock estimate.20:30.48 
Robin_Watts the cluster reports times in hours:minutes:seconds, and it's gone from 4:01:?? to 3:51:50 ish20:33.06 
  I'm not sure what the error margin is (though the before times were consistently within a minute when I did a couple of runs)20:33.40 
  and I lack the mental arithmetic skillz to work it out as a percentage (3.7% according to my calculator)20:34.04 
  I have some ideas to reduce path storage further that I want to try on the plane.20:34.59 
fredross-perry have fun storming the castle. Out.21:31.25 
Robin_Watts hi mvrhel_laptop. How's the skiing?22:50.35 
mvrhel_laptop Hi Robin: It was good. cold but there was a few inches of powder today22:51.24 
  we are done for the day now22:51.33 
Robin_Watts We fly tomorrow morning. Just off to bed now.23:00.18 
  see you in Denver :)23:00.24 
mvrhel_laptop have a great flight Robin_Watts 23:12.51 
Robin_Watts thanks. enjoy the snow tomorrow.23:13.00 
 Forward 1 day (to 2015/03/05)>>> 
ghostscript.com
Search: