Jump to content
IGNORED

Converting PNG to Atari


Recommended Posts

That's the best way. BUT: You have to first take the PNG into your favorite editor and resize it into an Atari friendly resolution, 320 or 160 pixels across. I would also (if doing an Antic 4 conversion) try taking it into the GIMP, posterize it down using an Atari palette and then reducing it to 5 colors for Antic 4 (or 9 colors if you are doing a Graphics 10 render). If doing a Graphics 0 render, posterize it to a 1-bit palette and choose whatever dithering method you want.

Link to comment
Share on other sites

is it possible for me to add my own Atari ICE picture formats to the Graphics editor? These are:

 

.IPC (12+10)

.IP2 (12=10 with color changes on the PF registers)

.ICN (12+11)

.IMN (12+9)

.DIN (0+12)

.IRG (12+12, no color changes)

.IR2 (12+12 with color changes on PF registers)

 

These formats were added recently to the new FAIL library, now known as RECOIL. Being able to convert to these using the WUSDN Graphics editor would be super!

Link to comment
Share on other sites

Depends on which direction of conversion you mean. For the PNG => Atari, just provide the Javascript Snippet and input/output samples and I'll add it.

function convertToFileData(data) {
var bpsl = (data.getImageDataWidth() + 3) / 4;
var bytes = [];
var offset = 0;
for (var y = 0; y < data.getImageDataHeight(); y++) {
   for (var x = 0; x < data.getImageDataWidth(); x = x + 4) {
var c1,c2,c3,c4;
c1 = data.getPixel(x, y) & 0x3;
c2 = data.getPixel(x+1, y) & 0x3;
c3 = data.getPixel(x+2, y) & 0x3;
c4 = data.getPixel(x+3, y) & 0x3;
bytes[offset++] = c1 << 6 | c2 << 4 | c3 << 2 | c4; 
   }
}
data.setTargetFileObject(0, bytes);
}

The conversion for Atari => PNG is based on FAIL 1.x. I stopped keeping up with FAIL/RECOIL some while ago simply because of priorities.

 

 

 

  • Like 2
Link to comment
Share on other sites

I haven't come up with an accurate javascript for doing these yet, but I think it may be possible to do by splitting the renders up into their component modes. The first thing to remember about these modes, is that the bitmap is laid out like on the C=64 modes: One 4x8 (or 8x8 hi-res) character at a time, with a DLI that changes the charset every three char lines to make the bitmap, unlike the hardware bitmap modes which take the display a scanline at a time.

 

So, for .IPC (PCIN) you want a Graphics 10 9-color bitmap converted into fonts, and an Antic 4 bitmap reduced to 5 colors, with the stipulation that the PF0-PF3 and BAK have to be the same for both renders. For .ICN it's a Graphics 11 font + Antic 4 monochrome bitmap, while .IMN is just a straightforward Graphics 9 + Antic 4 screen and no color register changes. It may be possible to render these off of other Atari formats in the converter, then combine them, then it'd just be getting the program to output the file to my specs. Up until now I have been using G2F to make the component renders, write font files, then compile an .XEX or manually convert them into my .IPC or other formats. I've also had to have my conversion program (in TurboBASIC) do antiflcker checkerboard dithering, for PCIN pictures where you are blending the PF0-PF3 and BAK registers on both renders. If this could be automated in WUSDN that'd be super cool.

 

The tricky one is .IR2 (Super IRG 2) because you're trying to get 25 blended colors from two palettes which match the original photo colors. A trick I haven't pulled off yet, tho I had an idea ... reduce the picture to 9 colors from the 128 palette, count them ... the most used color is BAK, the four least used will be the PF2-PF3 colors, then you stagger them in your palette and try to reduce the original picture to 25 colors based on the combined palette. Again, beyond my ken at the moment. :)

Edited by Synthpopalooza
Link to comment
Share on other sites

>When I double click on an atari format file, the graphics editor doesn't show it.

For formats mentioned on the web site I should do that. In any case you can use the "Open with Graphics Editor" in the context menu for any binary file. That's where it has it's root: Ripping Graphics from Amiga & C64 dumps :-)

Link to comment
Share on other sites

  • 2 years later...

Depends on which direction of conversion you mean. For the PNG => Atari, just provide the Javascript Snippet and input/output samples and I'll add it.

 

 

Hi Jac,

 

I'm a big fan of WUDSN and have been using it for some time now. I wrote a snippet to convert monochrome graphics to Apple II Hi-Res format (HGR) and thought it could be useful for others. You can add it to WUDSN if you like.

function convertToFileData(data) {
	var bytes = [];
	var offset = 0;
	var page = 0;
	var block = 0;
	var leaf = 0;
	for (var y = 0; y < data.getImageDataHeight(); y++) {
		page = y & 0x7;
		block = ((y >> 3) & 0x7);
		leaf = y >> 6;            
		offset = (page*1024) + (block*128) + (leaf*40);

		for (var x = 0; x < data.getImageDataWidth(); x = x + 7) {
			var b = 0;
			for (var i = 0; i < 7; i++) {
				var color;
				color = data.getPixel(x + i, y);
				if (color != 0) {
					b = b | 1 << i;
				}
			}
			bytes[offset++] = b;
		}
	}
	data.setTargetFileObject(0, bytes);
}
Link to comment
Share on other sites

 

I wrote a snippet to convert monochrome graphics to Apple II Hi-Res format (HGR) and thought it could be useful for others. You can add it to WUDSN if you like.


 

Hi cybernesto,

 

cool to see people sharing their stuff. Added a content type group for "Apple II Graphics", a converter group and this converter to the DEV branch 1.7.0 which will be released in 2018. I assume the size of HGR is fixed to 288x192.

Would be great if you could some sample files for PM, so I can also add the reverse conversion (display HGR files).

 

Regards, Peter.

post-17404-0-56636200-1514552271_thumb.png

  • Like 2
Link to comment
Share on other sites

 

Hi cybernesto,

 

cool to see people sharing their stuff. Added a content type group for "Apple II Graphics", a converter group and this converter to the DEV branch 1.7.0 which will be released in 2018. I assume the size of HGR is fixed to 288x192.

Would be great if you could some sample files for PM, so I can also add the reverse conversion (display HGR files).

 

Regards, Peter.

Thanks a lot. That is way more than I was asking for.

The current version of RECOIL is able to display monochrome hgr and dhgr graphic files. You might want to take a look into the code there for displaying previews.

Link to comment
Share on other sites

  • 6 months later...

Sign of life:

Other direction now finally also added for HGR with my own implementation.

Fox has provided me a RECOIL reuse jar build. But it will require Java 1.8 and I want to release WUDSN 1.7.0 still with compatibility to JDK 1.6.45,

After WUDSN 1.7.0 I will make a major update to the latest Java & Eclipse version.

post-17404-0-42477100-1531952365_thumb.png

  • Like 5
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...