Brilliant. Now that I got EPSCrop going, I am able to make my own rasters using mupdf, and it's working well.
eps -> pdf takes ~ 70ms pdf -> numpy array ~ 5ms (a 300dpi raster of 221x1884 pxl, I have run this with 8x8 aa and aa disabled and I got the same speed) SIFT feature detection -> 500ms ORB feature detector -> 250ms corner feature detector -> 80ms I suspect I can stand up gs once and make a giant pdf with one cropped page per input EPS, which is likely to improve the overall efficiency of the initial rasterization process a fair bit, but until I figure out whether this feature-based comparison concept even has merit, all that is secondary. One way or the other now I'm in a place where I can actually work :-) L On Sun, Sep 29, 2024 at 11:13 AM Han-Wen Nienhuys <hanw...@gmail.com> wrote: > On Sun, Sep 29, 2024 at 9:32 AM Luca Fascione <l.fasci...@gmail.com> > wrote: > > > > I'm using the same options that gv uses, nosafer and all, and gv > displays the file just fine. I've not fiddled with it enough to make gs > DRIVER=display work, because WSL2 and that driver don't seem to be on good > terms. But I'll spend some time on that today. > > Because I'm still experimenting with things, I'd rather have under > control how to go from a vector representation to a raster (I'dlike to > investigatethe effects of resolution and AA settings, for example), can I > use Cairo in pdf mode? > > You can use Cairo if you add > > LOCAL_LILYPOND_FLAGS=-dbackend=cairo > > local.make, and apply the following > commit e48daf754a323eca0c5b15f8677d4c9574c98ad4 (HEAD -> top) > Author: Han-Wen Nienhuys <hanw...@gmail.com> > Date: Sun Sep 29 10:56:46 2024 +0200 > > pdf > > diff --git a/make/lysdoc-targets.make b/make/lysdoc-targets.make > index 453b449575..f425c9de32 100644 > --- a/make/lysdoc-targets.make > +++ b/make/lysdoc-targets.make > @@ -19,7 +19,7 @@ lysdoc-test: > # Removing it works around incomplete dependencies. > rm -f $(outdir)/collated-files.texi > time $(MAKE) LILYPOND_BOOK_LILYPOND_FLAGS=" \ > --dseparate-page-formats=ps $(LILYPOND_JOBS) -dseparate-log-files \ > +-dseparate-page-formats=ps,pdf,png $(LILYPOND_JOBS) -dseparate-log-files \ > -ddeterministic \ > -dinclude-eps-fonts -dgs-load-fonts --header=texidoc \ > -dcheck-internal-types \ > @@ -27,7 +27,7 @@ lysdoc-test: > $(LOCAL_LILYPOND_FLAGS)" \ > LILYPOND_BOOK_WARN= \ > LYS_OUTPUT_DIR=$(top-build-dir)/out/lybook-testdb \ > - $(outdir)/collated-files.html > + $(outdir)/collated-files.pdf > # Later testing will find fonts via this link. > ( cd $(outdir) && \ > rm -rf share && \ > > > > On Sun, 29 Sept 2024, 09:26 Han-Wen Nienhuys, <hanw...@gmail.com> wrote: > >> > >> The EPS files have some tricks to keep sizes small (load font files > >> directly from the FS), which requires -dNOSAFER, and makes them more > >> fiddly. > >> > >> If you are trying to get up to speed with regression testing, you > >> could try running the whole thing (baseline and test) with > >> -dbackend=cairo which produces PNG files directly. > >> > >> On Sun, Sep 29, 2024 at 12:08 AM Luca Fascione <l.fasci...@gmail.com> > wrote: > >> > > >> > Hi, > >> > I'm trying to convert this file > >> > > $build/input/regression/out-test/tuplet-number-shift-along-kneed-beam.eps > >> > to pdf > >> > using epstopdf. > >> > This doesn't fail, and in fact gv shows the contents (using > -dNOSAFER). > >> > But the pdf produced seems to be an empty file. > >> > Or rather has some data in it, but gv displays the message > >> > > >> > Warning: Missing charsets in String to FontSet conversion > >> > > >> > And all pixels render white. > >> > > >> > I'm using GhostScript 9.55 and just remembered something about a > minimum > >> > version of GS being needed for lilypond EPS files. > >> > > >> > FWIW, if I read it correctly, epstopdf ends up doing just about this: > >> > cat > >> > > /home/lukes/src/lilypond-build/input/regression/out-test/tuplet-number-shift-along-kneed-beam.eps > >> > | gs -dNOSAFER -dNOPAUSE -dBATCH -dCompatibilityLevel=1.5 > -sDEVICE=pdfwrite > >> > > -sOutputFile=/tmp/lukes/lilypond/input/regression/out-test/tuplet-number-shift-along-kneed-beam.pdf > >> > -dPDFSETTINGS#/prepress -dMaxSubsetPct=100 -dEmbedAllFonts=true > >> > -dAutoRotatePages#/None -dDEBUG - -c quit > >> > > >> > Which I also tried on cmdline with the same result. > >> > > >> > I see on this page > >> > > >> > > https://lilypond.org/doc/v2.25/Documentation/contributor/requirements-for-running-lilypond > >> > > >> > that minimum GS is 9.03, though. > >> > > >> > Any clues? > >> > Cheers > >> > Luca > >> > > >> > -- > >> > Luca Fascione > >> > >> > >> > >> -- > >> Han-Wen Nienhuys - hanw...@gmail.com - http://www.xs4all.nl/~hanwen > > > > -- > Han-Wen Nienhuys - hanw...@gmail.com - http://www.xs4all.nl/~hanwen > -- Luca Fascione