Apple II graphics conversion

363 views
Skip to first unread message

Simon D. Williams

unread,
Jun 13, 2009, 3:11:25 PM6/13/09
to
Anyone know of a *nix program that can convert A2 graphics to a more
web-friendly format? Needs to be something I can run from the command
line.

Failing that, is there anything that can do the job on the IIgs?

] SIMON D WILLIAMS

John B. Matthews

unread,
Jun 13, 2009, 4:52:42 PM6/13/09
to
In article <Pine.NEB.4.64.09...@retro-net.org>,

I like AppleCommander. The command line version, ac.jar, needs Java, but
it can run without SWT:

<http://applecommander.sourceforge.net/>

Latest build:

<http://sites.google.com/site/drjohnbmatthews/applecommander>

Sample hires image:

<http://home.roadrunner.com/~jbmatthews/a2/nindex.html>

Example command:

java -jar ac.jar -e misc.dsk lucy.pic > lucy.png

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

atfphot...@gmail.com

unread,
Jun 13, 2009, 4:54:11 PM6/13/09
to

Hello!

There is a great program on that for the IIGS that will convert your
pics into GIF or TIF as well as a few others. Covert 3200 is the name
of the software.

ftp://ftp.apple.asimov.net/pub/apple_II/images/gs/graphics/

You should find an .SDK of it in that directory.

Best!

ATF

Simon D. Williams

unread,
Jun 14, 2009, 1:49:23 PM6/14/09
to
On Sat, 13 Jun 2009, John B. Matthews wrote:

> I like AppleCommander. The command line version, ac.jar, needs Java, but
> it can run without SWT:

Thanks for the tip, though it looks like Java's off the menu for
NetBSD/mac68k... :(

] SIMON D WILLIAMS

Simon D. Williams

unread,
Jun 14, 2009, 1:53:40 PM6/14/09
to
On Sat, 13 Jun 2009, atfphot...@gmail.com wrote:

> There is a great program on that for the IIGS that will convert your
> pics into GIF or TIF as well as a few others. Covert 3200 is the name
> of the software.

Stymied again! Convert 3200 requires System 6 and ~750K of free memory...
my IIgs has 1280K. Is it possible to convince System 6 to run on 500K?>

] SIMON D WILLIAMS

Michael Kent

unread,
Jun 16, 2009, 12:46:50 AM6/16/09
to
Simon D. Williams <ad...@retro-net.org> wrote:

> Stymied again! Convert 3200 requires System 6 and ~750K of free memory...
> my IIgs has 1280K. Is it possible to convince System 6 to run on 500K?>

Most GS software works just fine with 1280K. Have you tried it? If you
need more space, have you tried shift-booting?

Mike

--
Michael Kent Apple II Forever!
St. Peters, MO
Remove "." between "n" and "kent" to reply.

Charles

unread,
Jun 16, 2009, 8:17:15 PM6/16/09
to
Actually I'm looking for something that would go the opposite way -
regular web graphics - jpg, gif, png to Apple ][ HGR screen. (no
double hi-res or IIGS formats)

I understand there is a .gif viewer for the Apple ][ is that correct?
I've also heard it's pretty slow?

Here is some info:

http://www.vectronicsappleworld.com/appleii/gifviewer.html

I know the Apple ][ won't display images perfectly, but I was
wondering if anyone had any tips, Photoshop action, etc.

My guess for best practices would be to use a modern photo editor to
scale down the image, reduce the number of colors, convert to gif,
etc.

I'm wondering if there are any filters, cranking up the contrast,
would help with the process?

Any tips appreciated.

BLuRry

unread,
Jun 17, 2009, 11:12:27 AM6/17/09
to
Apple Game Server 3.0 code has the conversion built in -- it was
necessary to make it callable from a standalone client in order to
test it efficiently.

The following is my test program for the HGR conversion -- it does the
following:

1. Load image from gif or jpg file
2. Convert image (performed by HGR/DHGR/DHGR2) classes
3. Convert apple screen image into rasterized B&W format
4. Save rasterized B&W BMP file
5. Call standalone Blargg display test program to show how image would
appear on actual screen

For what you're doing, you can cut out steps 3-5 and just write the
binary data to a file. I meant to convert the Blargg code to java,
but never got around to it unfortunately. It's pretty dense C code
for sure. Beautiful and efficient, but oh so very dense.

The program is as follows:

/*
* DHGRTest.java
*
* Created on June 23, 2006, 6:41 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/

import ags.ui.graphics.Convert;
import ags.ui.graphics.HGRImage;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import javax.imageio.ImageIO;

public class HGRTest {
// Path to image viewer utility, e.g. Blargg's apple_ntsc demo
program
static String IMAGE_VIEWER_CMD = "/home/brobert/Documents/Personal/
blargg/dist/Debug/GNU-Linux-x86/blargg";

public static void main(String[] args) throws IOException,
InterruptedException {
HGRImage i = new HGRImage();
String sourceFile =
"/home/brobert/Pictures/CRW_1170_crop.jpg";
i.readColorImage(sourceFile);
//-----------------------------------
// Write binary data to a file for transfer to an apple
// This can be done through fishwings, ciderprsss or AGS.
// File f = new File("/home/brobert/Desktop/yiq#062000");
// OutputStream o = new FileOutputStream(f);
// o.write(i.getAppleImage());
// o.close();
//-----------------------------------
// Write out BW pattern to view
// Put in same directory as source image
// File outputDirectory = new File(sourceFile).getParentFile();
// Put in tmp directory
File outputDirectory = new File("/tmp");
File testPattern = File.createTempFile("test_hgr_bw",".bmp",
outputDirectory);
BufferedImage testbw = new BufferedImage(560, 192*2,
BufferedImage.TYPE_INT_RGB);
Convert.convertHGRtoBWRaster(i.getAppleImage(), testbw);
ImageIO.write(testbw, "bmp", testPattern);
// Call the image viewer, passing the B&W image file path as a
parameter
Runtime.getRuntime().exec(new String[]{IMAGE_VIEWER_CMD,
testPattern.getAbsolutePath()});

// Tell java to remove BW file
testPattern.deleteOnExit();
// Give viewer app enough time to read file
// otherwise program might exit and delte file too soon.
Thread.sleep(1000);
}
/** Creates a new instance of DHGRTest */
public HGRTest() {

Simon D. Williams

unread,
Jun 17, 2009, 12:37:00 PM6/17/09
to
On Tue, 16 Jun 2009, Michael Kent wrote:

> Most GS software works just fine with 1280K. Have you tried it? If you
> need more space, have you tried shift-booting?

Indeed I have... I'm running 6.0.1 with the Program Launcher instead of
the Finder, starting up with NO Inits/DA's and that leaves 599KB free...
Convert3200 requires 704KB.

I'm not all that familiar with GS/OS, so maybe there's something I can
remove/disable to free up more memory?

] SIMON D WILLIAMS

Charles

unread,
Jun 17, 2009, 12:40:46 PM6/17/09
to
Hi Brendan,

Yes, I just saw your post on the comp.sys.apple2.programmers when you
added the code to AGS.

I just tried downloading and running AGS 3, and it complained about
the rxtx library not being where it should be (I'm running it on a
Windows 2000 machine and just installed jdk1.6.0_14) and so I
downloaded the rxtx library and that talked about needing to be
compiled and I wasn't sure how to do that.

So I've hit the ceiling of my abilities unfortunately because AGS 3
sounds like great software - but I think you are really limiting your
audience if they need to compile/tweak and do other things to get it
to work.

I appreciate that the graphics code is available but I wouldn't begin
to know where to start since I don't know how to do "hello world" in
java...

Is there a way to make the code above into a standalone applet that
you can double click on – and have the ability to choose an image –
which then it saves to .dsk that could then be read/copied by an
emulator / Ciderpress?

Or, if it makes it easier, it just converts whatever file is named
image.jpg that is in the same folder as the applet?

Regarding bit collision, the only thing I’ve seen along those lines is
Lazilong’s work – his Apple ][ HGR to modern image format application
& Photoshop plug-in (Mac only).

Some samples here: http://www.lazilong.com/apple_II/a2pix/images/scrnshot/index.html

Excellent DHGR demo image showing differences:
http://www.lazilong.com/apple_II/a2pix/new_images/bernie.html

I realize that this is going the opposite way – from existing HGR to
modern format – but I thought it might be of use.

Readme: http://www.lazilong.com/apple_II/a2pix/readme.html (at the
bottom he describes the different palettes and bit shifting)

Simon D. Williams

unread,
Jun 17, 2009, 12:44:05 PM6/17/09
to
On Tue, 16 Jun 2009, Charles wrote:

> I understand there is a .gif viewer for the Apple ][ is that correct?
> I've also heard it's pretty slow?

It's not exactly fast, but it's not painfully slow either.

> I know the Apple ][ won't display images perfectly, but I was
> wondering if anyone had any tips, Photoshop action, etc.
>
> My guess for best practices would be to use a modern photo editor to
> scale down the image, reduce the number of colors, convert to gif,
> etc.

I've played with this a bit... I found that it doesn't translate colours
very well, but b/w stuff is fine. Best results if you resize/crop your
artwork to 280 x 192 px and then try different dither settings when saving
as gif.

][ Gif can convert giff to HGR too.

] SIMON D WILLIAMS

Simon D. Williams

unread,
Jun 17, 2009, 5:51:23 PM6/17/09
to
On Wed, 17 Jun 2009, Simon D. Williams wrote:

> 280 x 192 px and then try different dither settings when saving as gif.

Just to clarify, I generally edit images as greyscale in photoshop and
then set the palette to black & white in "Save for Web" -- dithering is
how the "grey areas" are converted to black & white.

I find using a "pattern" dither has a nice effect, but it really depends
on the nature of the original image.

] SIMON D WILLIAMS

BLuRry

unread,
Jun 18, 2009, 12:59:39 AM6/18/09
to
On Jun 17, 11:40 am, Charles <thedangerman...@yahoo.com> wrote:
> Hi Brendan,
>
> Yes, I just saw your post on the comp.sys.apple2.programmers when you
> added the code to AGS.
>
> I just tried downloading and running AGS 3, and it complained about
> the rxtx library not being where it should be (I'm running it on a
> Windows 2000 machine and just installed jdk1.6.0_14) and so I
> downloaded the rxtx library and that talked about needing to be
> compiled and I wasn't sure how to do that.

The windows RXTX library ships with AGS in the dist/lib directory --
however you shouldn't have to worry about though since you don't need
to compile the AGS source, just compile your own code against it by
adding ags.jar to the classpath. I sent you an email with more
details about that.


>
> So I've hit the ceiling of my abilities unfortunately because AGS 3
> sounds like great software - but I think you are really limiting your
> audience if they need to compile/tweak and do other things to get it
> to work.

Well, that wasn't the intention -- again, using ags.jar from your own
program should be sufficient unless you want to call the serial logic,
in which case RXTX needs to be present in order to work.

>
> I appreciate that the graphics code is available but I wouldn't begin
> to know where to start since I don't know how to do "hello world" in
> java...
>
> Is there a way to make the code above into a standalone applet that
> you can double click on – and have the ability to choose an image –
> which then it saves to .dsk that could then be read/copied by an
> emulator / Ciderpress?
>
> Or, if it makes it easier, it just converts whatever file is named
> image.jpg that is in the same folder as the applet?
>
> Regarding bit collision, the only thing I’ve seen along those lines is
> Lazilong’s work – his Apple ][ HGR to modern image format application
> & Photoshop plug-in (Mac only).
>
> Some samples here:http://www.lazilong.com/apple_II/a2pix/images/scrnshot/index.html
>
> Excellent DHGR demo image showing differences:
>  http://www.lazilong.com/apple_II/a2pix/new_images/bernie.html
>
> I realize that this is going the opposite way – from existing HGR to
> modern format – but I thought it might be of use.
>

> Readme:http://www.lazilong.com/apple_II/a2pix/readme.html(at the

Reply all
Reply to author
Forward
0 new messages