When exporting a document with bitmap images in it, Inkscape won’t downsample them to a lower resolution, despite the “Resolution for rasterization (dpi)” setting in the PDF export dialog. That export dialog setting only applies to bitmaps that have had filters applied against them. See bug 246677.
4 years ago I figured out how to work around this and today I had to relearn it. So as to not repeat this in another 4 years, I’m documenting this here for posterity.
The workaround is to apply an identity filter to each bitmap before saving it. An identity filter is one that doesn’t do anything, but because it is a filter it forces Inkscape to do the downsampling upon export. Because an identity filter doesn’t actually do anything, there isn’t one available in the Filters menu, but we can create one.
To create a reusable identity filter:
- Open a new Inkscape file
- From the Filters menu, select Filter Editor…
- In the Filter Editor pane, click the New button. This will add the filter “filter1” to the Filter list
- Double click “filter1” and rename it “Identity”
- To the right of the Add Effect: button there is a drop-down. Change it to Color Matrix, and hit the Add Effect: button
- Save the document as “Identity filter.svg”
- Now put the file where Inkscape can find it:
- Linux/OS X: ~/.config/inkscape/filters
- Windows XP: C:\Documents and Settings\[USERNAME]\Application Data\Inkscape\filters
- Windows Vista and later: C:\Users\[USERNAME]\AppData\Roaming\Inkscape\filters
- The ‘filters’ directory may not exist, in which case just create it.
- Close and restart Inkscape
- This should add the Personal submenu under the Filters menu which should include our Identity filter.
To use the identity filter:
- In your Inkscape file, select the bitmaps you want to downsample. Be sure not to select any vector images or text since you don’t want to rasterize that.
- From the Filters menu, select Personal > Identity
- Now when you save the document as a PDF, adjust the “Resolution for rasterization (dpi)” setting. 90 is a decent number for documents that are being viewed on a computer screen. 150 is probably the smallest you want to go for anything that is being printed.
At work, I have my music collection on my Fedora desktop. At times I’ve wanted to access this library on my Mac Book Air but have been unable to do so given they are on two separate subnets (and DAAP is a broadcast protocol). The solution was Network Beacon.
- Ensure your DAAP server is accessible. For Rythmbox, enable/configure the DAAP Music Sharing plugin (be sure to click the ‘Share my music’ checkbox for the plugin).
- Make sure port 3689 is open on your Linux firewall if necessary.
- On the Mac, download and install Network Beacon and configure a new beacon thusly:
- Beacon Enabled: Yes
- Service Name: [string of your choice]
- Service Type: _daap._tcp
- Port Number: 3689
- Enable Host Proxy: Yes
- Host Name: [full hostname]
- IP Address: [duh]
- Now you should be able to open iTunes and see the DAAP share appear in the SHARED section. Note that Network Beacon must remain running for iTunes to see the remote share.
Note that if the machines were on the same subnet you should be able to skip Network Beacon entirely and just enable the DAAP Music Sharing and punch the hole through the Linux firewall.
Yesterday I received my new 15″ MacBook Pro from FedEx and I’m sure I’ll be spending the next several evenings getting it all set up. I’ve christened it Seregil from the character of Lynn Flewelling’s Nightrunner series. (I always name my computers from characters in books — usually those I’m reading or have read recently.) It is spec’d out thusly:
- MacBook Pro
- 15″ high-density anti-glare screen
- i5 2.4GHz CPU
- 8GB RAM
- 128GB SSD
For the past 4 years I’ve used Linux systems exclusively and when it came to purchase a new computer I decided to jump to Mac. Moving to Linux from Windows was the most productivity-enhancing change I’ve ever made and I’m hoping the swap to Mac doesn’t set me back. What appeals to me so much about Macs is that they have the classic unix underpinnings with an elegant GUI.
Currently I have a Windows VM which I use solely to put music on my iPhone. That’s going straight to /dev/null. Instead I’ll be creating a Fedora 13 (14?) VM as a backup for those things that just need a Linux touch to them. For instance, I’m going to give Apple Mail a chance, but if it just doesn’t pan out, I’ll run Evolution on the VM using VMware Fusion with Unity. I’m interested to see if The Gimp, Inkscape, and other X-Windows dependent apps behave better running in the VM rather than directly on the OS X X-server. While they function well, they just aren’t really integrated into the OS X UI.
I already have Adium, Unison, Moneydance, LibreOffice (aka: OpenOffice), and Chrome installed and configured. My iPhone library is moved over and correctly synching with my phone thanks to a bit of work getting the Library IDs sync’d between the two. Now to get VMware Fusion installed and that Linux VM created.
Growing up in a print shop gives me a unique knowledge of all things print. Stray too far outside of the spot color domain however and I have to start getting resourceful.
My family’s business has always used offset presses. And even while they have T-heads to enable the simultaneous printing of 2 colors — the ink has always been Pantone spot colors. This means that whatever we designed, be it on the old negative-creating typesetter circa 1980 or Adobe InDesign, would come out black-and-white in the end to be “converted” to a single spot color on the presses. [Aside: I’m not even going to get into the use of halftone screens and the camera in order to make printable photos — lets just gloss all over that and say it all ended up in black and white.] At no time did I ever need to delve into the process color domain. I knew it existed, I grok the basic concepts, but I didn’t have to concern myself with it.
Recently Benjamin was designing a banner in Inkscape that was to be printed by a 3rd party vendor who specifically requested the document be in CMYK. I dug around and discovered that while Inkscape has some tentative support for CMYK, it is unable to export EPS files in that color space. The work-around is to import the SVG file into Scribus and create the EPS from there as Scribus has better color management support. The tricky part is that Benjamin had used three high-resolution JPEGs in the SVG — JPEGs that were in the sRGB color space. I attempted to use jpegicc utility from littlecms to convert the image from the sRGB color space to a CMYK color space using an Adobe ICC file which succeeded. However, viewing these images did not give me a comfortable feeling that they would look good in print. I ended up punting the work altogether and asked a friend to use Adobe PhotoShop to do the conversion. I was then able to do the Inkscape -> Scribus route to get the final EPS format.
The banner was reported shipped yesterday. Hopefully my color space wrangling worked and it’ll look good upon arrival.
Yesterday Benjamin was having some challenges trying to copy text out of OpenOffice (a full Aqua app) and paste it into an Inkscape (an X11 app) document he was creating. The challenge was that it wasn’t working.
After digging around a bit I discovered that the X11 app didn’t have pasteboard syncing enabled. To fix this we went into the Preferences for the X11 app, selected the Pasteboard tab, and enabled syncing using only the ‘Update PRIMARY when Pasteboard changes’ option. Problem solved!
Unfortunately it also messes up copying and pasting vector images from within Inkscape. Looks like this is a setting that will have to be toggled on and off based on what you want to be doing for your copy/paste action. Rather a pain I think.
One of the odd challenges I encountered with getting Inkscape working on Sebastian were the fonts. The fonts showed up in the usual slew of non-X11 applications but refused to show up in Inkscape. I admit to not have tried the Gimp in this state although I assume this is a fonts-in-X11-apps issue and not specifically Inkscape and thus the Gimp would have had the same problems.
A bit of googling resulted in this forum post that solved the problem nicely.
Macs present both a system-specific (under /Library) and user-specific (under [User]/Library) view of several system resources, such as Fonts. The concept being that a specific user can install a resource under their login ID ([User]/Library/Fonts) and that resource is only available for that user’s login ID. Logging in as another user would not expose those resources. The end-user helpfully sees a superset of both the System and User resources exposed to them in the interface.
If you want a resource made available to all users on the system you place them in the System resources instead of the User resources and in order to install a System resource a privilege escalation is required. Like any good OS this helps limit the damage that any given user can inflict to the system.
Extrapolating from my geek knowledge, it appears the core of the issue is how X11 interacts with user resources — or rather how it doesn’t interact with them. My suspicion is that the X11 subsystem only pulls the System fonts, and not the superset of the System and User fonts, which is the reason why moving fonts from the User resources to the System resources caused them to show up in Inkscape.
Next up on my Mac OS X to-investigate list: making printer defaults stick in X11 apps.
Over the past several years Benjamin has developed several documents for use with his business, Memento & Co. These documents are designed in Word and originally had the letterhead on them as well. This proved problematic when we moved because in order to update the contact information he had to open and change each and every document. Word doesn’t provide a way to single-source documents and we decided we needed to do this differently.
B had been using CutePDF to create PDFs of his Word documents for a while so I started poking around to see if there was a way to “merge” two PDFs together: we’d create one PDF with the letterhead that he could use to merge on the first page of Word document printed to a PDF. I discovered pdftk would do the trick. Using this technique B was able to design his letterhead in Inkscape and save it as a PDF document. Using Inkscape allowed for a crisp logo (also designed in Inkscape) and no longer required rasterizing the vector logo into a high-resolution image just to place it into a Word document! He could then run a VB script I write which would prompt for the PDF onto which the letterhead should be applied and the script called pdftk to do the actual work.
Now enter the move to Sebastian and Mac OS X. Initially the process seemed much simpler. OpenOffice can export to a PDF out-of-the-box removing the need for CutePDF. Automator can apply a watermark to a PDF but only if the watermark is a raster image, not another PDF. Moreover it doesn’t tell you that anywhere but simply doesn’t do anything to the desired file making it a frustrating task to figure out what was going wrong. Drat, we’d have to go back to pdftk.
Getting pdftk on the system was a bit more challenging as the program doesn’t come in a DMG. Luckily it is included as a port so the process was a simple ‘port install pdftk’. I then used the Automator to provide a Finder menu option that B can use to apply the letterhead to one or more files. The Automator calls a shell script that calls pdftk to do the actual work.
Many of the applications that Benjamin used on Meme, his Windows XP machine, were ports for the Linux realm: Gimp (raster image editor), Inkscape (vector image editor), and Nvu (WYSIWYG web editor). Luckily all of these are available on Mac OS X although not without some pain.
- Inkscape was the easiest as they had a downloadable DMG – easy as pie. Open source developers — this is the way to go!
- Gimp was more challenging. I initially thought about just installing it via port but didn’t like the idea. There are a couple of DMG-based ports (sounds like typical infighting from open-source developers) which sounded much easier. After I got one installed it wasn’t playing nice with the font size — the ‘F’ for the File menu on the toolbar was bigger than this 13″ MacBook Pro screen! After much googling around a bit I found the Gimp resource file which somehow had gotten a font size of 934! Changing this down to 10 made the Gimp work.
- The no-longer-developed Nvu wasn’t available on Mac. Instead a fork called KompoZer is, provided in a nice DMG for installing. It appears to work identically to Nvu and was an easy transition.
Inkscape and Gimp are pure X11 apps meaning that X11 has to be running in order to provide the infrastructure for these two apps to run. Coming from a Linux background this makes perfect sense. It took a bit of explaining for B to understand why the X11 app appeared running on his Dock when he started one of these apps — and why he shouldn’t just kill it until he was done with them!
One of his most important apps was certainly not a port from Linux: MS Office. Being the cheap person that I am I encouraged B to try OpenOffice and if that really just didn’t meet his need then we would evaluate Pages or bite the bullet and purchase MS Office for Mac. I was very pleasantly surprised to find that OpenOffice isn’t just running on top of X11 but is a full-fledged Aqua app! This dramatically helped B towards my goal of giving OOo a shot and so far I think it’s been an easy transition. I know he’s been using it extensively during the past few weeks he was out of town. I’m uncertain if I haven’t heard complaints because it has Just Worked or because he’s been too busy with other things to make his case for an alternative office suite.
I’ve only played with Sebastian, B’s MacBook Pro, for a few hours while getting it configured for B, but from what I’ve seen I really like it.
For the past several years I’ve been running Linux both on my desktop and my laptop. The recent move from RHEL to Fedora on both systems helped with the usability issues but it’s obvious to me that Linux still doesn’t have the spit-and-polish that end-users expect on a desktop workstation. Still, I’m much more productive on a unix-based system than I ever was on a Windows-based system even with cygwin installed.
OS X seems to have the best of both worlds: a unix system with a very polished desktop environment. Moreover Apple isn’t trying to hide the unix underpinnings either — you can easily run a bash/ksh/perl/etc script from the Automator. A real scripting language built right into the OS — no more learning VB scripts just to automate some of B’s tasks! [Aside: powershell might address some of this gripe for Windows systems, and I’ve heard great things about it, but it’s been a long time coming.]
While out at a customer site last week two of the IBMers out on-site were using Macs. When my laptop comes due for an upgrade in ~1.5 years rest assured I’ll be moving to a Mac either on IBM’s dime or my own.
Benjamin’s Sony Viao, Meme (pronounced Mem’-ee), has been slowly dying. Well, I guess technically it isn’t his computer per se but the battery. At the end of last year the battery purchased with the computer 3 years ago was shot and after weighing the options we opted to purchase another battery with hopes that it would last until he graduated next May. Instead the $80 battery instead lasted a full 6 months before it too was powering the laptop for only 2 minutes — just enough time to rush from a power outlet upstairs to one downstairs but not enough to get anything productive done.
While flying back from DC early last month B used my laptop to get some work done on the airplane. We discovered that having something to work on significantly reduced his flight-induced anxiety. [Aside: B has had anxiety now for a few years and in general it’s under control. Flying can jump him up on the “not doing well” scale and it’s worse when I’m not flying with him.] Knowing that B would be flying to Houston by himself just three days after we got back from DC, we decided that we needed to get him a truly mobile laptop before then.
The plan has been to purchase a Mac when we eventually did replace the Viao — the question was: is it time to do that now or to buy another battery? The previous battery we ordered online. This time that wasn’t an option given our 2-day time window. So we went trucking off to the Cherry Creek Mall which as both an Apple and Sony store. We first dropped by the Apple store to confirm they had the 13″ MacBook Pro in stock. We then walked down to the Sony store to ask if they had a battery for the Viao in-stock. If so our plan was to fork out the ~$100 for a battery and defer the MacBook purchase until later. The not-so-very-helpful gentleman at the Sony store said that they didn’t stock it but we could order it online. Instead we went back to the Apple store and purchased the 13″ MacBook Pro which was christened Sebastian.
That evening I got a crash course in Mac OS X and after many hours of rsync’ing data we had all of B’s music, photos, and documents off Meme and onto Sebastian. By the end of the next day I had OpenOffice, The Gimp, Inkscape, and KompoZer installed and he was off and running. We’re both still learning things about it but I really like what I’ve seen so far. More importantly B appears to really like it.