How to install/implement HPGL(hp2xx) converter?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
sasha310813
Posts: 5
Joined: 2014-08-05T07:34:34-07:00
Authentication code: 6789

How to install/implement HPGL(hp2xx) converter?

Post by sasha310813 »

Hi everybody!

Please, could someone explain me in step-by-step mode how to install/implement HPGL(hp2xx) converter into ImageMagick for Wiindows XP SP3?
I found this ftp://ftp.gnu.org/gnu/hp2xx/hp2xx-3.4.4.tar.gz , but I don't understand how to install it and use it with ImageMagick to convert from HPGL to JPG, PNG etc.

Thank you in advance!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to install/implement HPGL(hp2xx) converter?

Post by snibgo »

Once you have a binary program in a directory on your path, IM should be able to read HPG files, using hp2xx as the delegate. If I had an HPG file, I could test this. Perhaps you can put one somewhere like dropbox.com and paste the URL here.

That archive file doesn't contain any binaries. You could compile it yourself. Or Cygwin contains Windows binaries, so you can probably download them without all the other Cygwin stuff.
snibgo's IM pages: im.snibgo.com
sasha310813
Posts: 5
Joined: 2014-08-05T07:34:34-07:00
Authentication code: 6789

Re: How to install/implement HPGL(hp2xx) converter?

Post by sasha310813 »

Thank you for the response.
Yes, I have a test file, here is the dropbox link: https://dl.dropboxusercontent.com/u/445 ... /test01.hp
And here's the converted png file: https://dl.dropboxusercontent.com/u/445 ... test01.png
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to install/implement HPGL(hp2xx) converter?

Post by snibgo »

With IM 6.8.9-5 on Windows 8.1, with hp2xx in a directory on my path, the conversion works fine except that your PNG file has light blue text that doesn't appear on my output.

Code: Select all

convert hpg:test01.hp t.png
Without "hpg:", IM doesn't know what to do with it.

I suggest: From the Cygwin homepage https://cygwin.com/, run the 64-bit or 32-bit installation program. For my 64-bit computer, this downloads and runs setup-x86_64.exe. This runs as a conventional Windows installation, but you are given the choice of what packages to install. Un-tick everything, because the default is to download and install a whole load of stuff that takes hours. In this very long list, find hp2xx. Click this until it says "install".

Continue with the installation. At the end, it should put hp2xx.exe in a directory, something like C:\cygwin64\bin. Either put this directory on your path, or copy the files to a directory on your path. The command I gave should now work.
snibgo's IM pages: im.snibgo.com
sasha310813
Posts: 5
Joined: 2014-08-05T07:34:34-07:00
Authentication code: 6789

Re: How to install/implement HPGL(hp2xx) converter?

Post by sasha310813 »

THANK YOU VERY MUCH!!!
Now it works! BTW, i guess i discovered that i didn't need any implememtation of hpgl(hp2xx), because it was already there, i only had to change the extension from .hp to .hpg, or use your advice, putting "hpg:" before hpgl file to convert.
Ghostscript needs to be installed for this conversion.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to install/implement HPGL(hp2xx) converter?

Post by snibgo »

Ah, yes, it also needs Ghostscript. Thanks for spotting that. I should have seen that ("-verbose" would have told me). This is because it goes via EPS format.

I'm curious about the blue text. Should it be present? Or did you scan a printout?
snibgo's IM pages: im.snibgo.com
sasha310813
Posts: 5
Joined: 2014-08-05T07:34:34-07:00
Authentication code: 6789

Re: How to install/implement HPGL(hp2xx) converter?

Post by sasha310813 »

Well, you're right, the converted png through ImageMagick is different from the one i have as the example file (that was converted by me from the same hpgl file through Total CAD Converter online program http://www.coolutils.com/Online/CAD-Converter/).
I think that those colors depend on the default settings of the hpgl converter, it should be possible to change those colors, in fact i think that i'll have to try to change those colors, but for now the fact that i can convert hpgl to png or other formats is great news!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to install/implement HPGL(hp2xx) converter?

Post by snibgo »

Code: Select all

hp2xx -m png test01.hp
... gives a black and white image, with text. So yes, I agree, it's some kind of hp2xx settings. Once you work out what they are, you can edit the file delegates.xml in your ImageMagick directory to suit.
snibgo's IM pages: im.snibgo.com
sasha310813
Posts: 5
Joined: 2014-08-05T07:34:34-07:00
Authentication code: 6789

Re: How to install/implement HPGL(hp2xx) converter?

Post by sasha310813 »

Great! Thank you very much again for your help! :)
Post Reply