Image2Mode7 - general image to teletext converter

discussion of beeb/electron applications, languages, utils and educational s/w
User avatar
simonm
Posts: 177
Joined: Mon May 09, 2016 2:40 pm
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby simonm » Wed Sep 28, 2016 9:02 pm

I tried this for some fun, it's 78x75 and primary colours.
pirhana.png
pirhana.png (608 Bytes) Viewed 174 times

Result is
Capture.PNG

Link

User avatar
kieranhj
Posts: 607
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby kieranhj » Thu Sep 29, 2016 9:43 pm

joachim wrote:I dismissed ordered dither because it's not so obvious how it can adapt to the changing palette constraints: an error propagation method will happily create a colour in one place by dithering red with blue, and create the same colour in another place by dithering black with magenta, just because it started with a different palette state.

But perhaps that's not the only or most important consideration. Ordered dither would also have the advantage of not blowing up the search space, like we were discussing upthread, to store error propagation information.

Yes, I was struggling with how to integrate ordered dithering into the algorithm that is based on minimising error but came up with something:

Palette test
Dylan Cat
Red Parrot
Parrot 3

This is all with 4x4 Bayer matrix. 3x3 or even 2x2 might work better with the resolution limitations. Don't have time now (even to upload pics) but will post a patch over the weekend.
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

joachim
Posts: 128
Joined: Wed Jun 21, 2006 1:20 am
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby joachim » Fri Sep 30, 2016 5:24 pm

Nice! Is the alternating colour in the cat's sky part of a three-colour dither matrix, or did you do some error propagation?

kieranhj wrote:This is all with 4x4 Bayer matrix. 3x3 or even 2x2 might work better with the resolution limitations. Don't have time now (even to upload pics) but will post a patch over the weekend.

2x2 (or 2xn, e.g. 2x4) would make horizontally adjacent characters the same, which might enable taking advantage of the hold character for better transitions.

User avatar
kieranhj
Posts: 607
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby kieranhj » Wed Oct 05, 2016 2:21 pm

Must stop fiddling with the tool. Added rudimentary dithering support and made basic implementation faster (realised I can calculate the optimal graphics character for cell directly from the error of each pixel being on/off rather than having to try all 64 possible combinations.)

I am going to try and leave it here so I can work on other fun stuff (I said that last time.)

2x2 ordered dithering:
dither2x2.png

3x3 ordered dithering:
dither3x3.png

4x4 ordered dithering:
dither4x4.png

2x3 ordered-ish dithering (to match 2x3 graphics character cell):
dither2x3.png

Red Parrot regular / dithered / separated:
red_parrot.png
red_parrot_dither2x3.png
red_parrot_sep.png
Attachments
image2mode7_v3.zip
Latest version of image2mode7 tool
(380.27 KiB) Downloaded 42 times
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby pixelblip » Wed Oct 05, 2016 7:03 pm

Ahh this is awesome..........the last picture looks really great. I can see a teletext art gallery on the horizon !
Looking at those squares got me thinking about lots of ideas..........something close to my heart at the moment.......dithering and colours :D

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby pixelblip » Wed Oct 05, 2016 7:31 pm

I got the command to run and output something. How do you view your final output please? Is it a jpg or do you need a teletext editor of some kind to open it?
Ta

User avatar
tricky
Posts: 2290
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby tricky » Wed Oct 05, 2016 8:00 pm

pixelblip, you can output the URL, which will display in an editor on the web page, or add the file to a .ssd and then *LOAD image 7C00 in an emulator.

Just tried the 2x3 conversions and they seem to show a bug in beebem teletext mode (v4.03 and 4.13).
beebem_bug.png

Original:
Image
Attachments
test.zip
(1.1 KiB) Downloaded 23 times
Image00.png
Image00.png (497 Bytes) Viewed 174 times

User avatar
tricky
Posts: 2290
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby tricky » Wed Oct 05, 2016 8:02 pm

I know you want to park this for now, but I also had a thought about the original scaling and the fact that the blocks aren't all the same size.
I'm sure it isn't worth it, but you could take the size of the block in to account when deciding which part of the original image it would cover!
I know, I don't think it is worth the effort, but had to mention it now that I have thought of it!

User avatar
tricky
Posts: 2290
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby tricky » Wed Oct 05, 2016 8:14 pm

Sorry to hog your thread, but I also just tried part of my frogger sprite page at 1:1 and it shows what a difference the position of an image relative to the character position can make. I doubt it will be anything like this on a picture and I can easily automate making six copies for my own stuff.
Sprites:
Image
Teletext:
frogger_test.png
Attachments
frogger.png
frogger.png (2.38 KiB) Viewed 174 times

User avatar
kieranhj
Posts: 607
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby kieranhj » Wed Oct 05, 2016 9:23 pm

pixelblip wrote:I got the command to run and output something. How do you view your final output please? Is it a jpg or do you need a teletext editor of some kind to open it?
Ta

Sorry, the documentation isn't great. If you use the -h flag it lists all the options. By default it will spit out a .bin file which can be *LOADed at 7C00 in MODE 7 on a Beeb to view. To make this a tiny bit easier the -inf flag will spit out a .inf file that can be used with bbcim.exe or the other SSD file conversion tools to make a Beeb disk image ready for an emulator or transfer to device using MMC etc.

Other preview options include -url which will print out a http://edit.tf URL - just paste this directly into your browser of choice to view in the awesome edit.tf online Teletext editor.

Finally you can also drag & drop the .bin file into the Image2BBC_ImportTTX tool from Francis but beware there is a bug in the released version that means sometimes the hold graphics character will not be displayed correctly (might end up with black character gaps in places) - Francis has fixed this but not released an updated exe as yet (hopefully soon.)
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby pixelblip » Thu Oct 06, 2016 5:55 am

Thanks for the instructions =D>

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby pixelblip » Thu Oct 06, 2016 6:12 pm

My Robot came out like this
Mode 2 Robot Final Pic.jpg
Attachments
Mode 7 Robot.png

guesser
Posts: 168
Joined: Mon Jun 26, 2006 9:21 pm

Re: Image2Mode7 - general image to teletext converter

Postby guesser » Fri Oct 14, 2016 11:03 pm

The results you've managed are amazing. I'll admit when I first saw this thread I thought "hah, that's never going to work" :oops:

Can I be cheeky and ask if you'd mind uploading the parrot image on wikipedia? There's a couple of pages with examples of colour palettes and the one purporting to represent teletext gets on my nerves as it's a naive two colour per block mapping that's not possible on standard level 1 teletext. [-X

https://en.wikipedia.org/wiki/List_of_c ... t_machines
https://en.wikipedia.org/wiki/File:Scre ... letext.png
A web based teletext editor which can export as Mode 7 screen memory: https://zxnet.co.uk/teletext/editor

JSeymour
Posts: 3
Joined: Wed Nov 16, 2016 8:45 am
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby JSeymour » Thu Nov 17, 2016 2:59 am

Just got this working, it's a great tool!
Last edited by JSeymour on Fri Nov 18, 2016 9:17 am, edited 2 times in total.

Commie_User
Posts: 1057
Joined: Wed Jan 27, 2016 12:50 am
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby Commie_User » Thu Nov 17, 2016 10:51 pm

kieranhj wrote:The algorithm does sometimes produce weird and funky sequences of control codes, so could do with some further investigation and debugging, but overall it seems to work. Given the command-line parameters are a bit opaque, it could do with a lovely Windows app with real-time preview to tweak the values with sliders but I don't really write Windows apps (oh, the irony.)


There's still this, a Windows tool for converting images to (nearly) any mode: viewtopic.php?f=2&t=12034#p152832

And when they're done and put to disk or tape image, just *LOAD that stuff.

Commie_User
Posts: 1057
Joined: Wed Jan 27, 2016 12:50 am
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby Commie_User » Thu Nov 17, 2016 11:04 pm

And yes, the parrot IS amazing!

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby pixelblip » Mon Jan 09, 2017 7:52 pm

Tried another pic of mine tonight.
Really think this Mode 7 tool is amazing. Makes me wanna do Mode 7 Art!
Attachments
Nuc2.jpg
Nuc.jpg

User avatar
kieranhj
Posts: 607
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby kieranhj » Mon Jan 09, 2017 8:51 pm

pixelblip wrote:Tried another pic of mine tonight.
Really think this Mode 7 tool is amazing. Makes me wanna do Mode 7 Art!

Thanks! I love you pictures & art style BTW, as someone else also said they hardly look like BBC images at all, great use of colour mixing gives an impression of a much wider palette. Would you be interested in making some screens and logos for one of our Bitshifters demo sometime?

Also, if you are interested in MODE 7 / Teletext art then keep the last Sunday of February free in your diary. I am helping some Teletext retro artists & enthusiasts on Twitter organise an art workshop event in Bolton & Cambridge. It'll be open to all with hands-on workshops for how to make art with Teletext tools including a performance from a professional artist who uses retro computers as a medium. Should be fun! I'll post more details on the events forum when I have them or PM me.
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby pixelblip » Mon Jan 09, 2017 9:20 pm

I'd be happy to....thanks......that sounds like fun.....and thank you for the nice compliment. Some more piccies coming soon!
I will keep my eye open for February....I love teletext stuff......used to use 'Movie Maker' by Slippery Slug all those years ago :wink:

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby pixelblip » Sat Mar 25, 2017 8:40 pm

Here's my Spring Pic in Mode 7
Looks really good!
There's a lot of life yet in Mode 7.
Your converter is amazing.
Attachments
SpringPic.jpg

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby pixelblip » Sat Mar 25, 2017 9:24 pm

And some more.
Attachments
w7.jpg
mp7.jpg
is7.jpg
city7.jpg

User avatar
kieranhj
Posts: 607
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby kieranhj » Sat Mar 25, 2017 9:32 pm

Glad you're still enjoying it. I was pondering last night a ~ 192 x 125 pixel 8 colour mode by using all characters in MODE 7 whilst reducing CRTC R9. If I ever get it working I'll post the results.
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby pixelblip » Sat Mar 25, 2017 9:33 pm

Great..........
The colours really pop out at you in teletext mode don't they.
I really enjoyed reading about your dithering / patterns in this thread. Right up my street.

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby pixelblip » Sat Dec 16, 2017 9:07 pm

I was thinking just now it would be ace to see this converter as a windows app with drag and drop.
I wanted to use it again tonight but thought ' where do I start ' - as it's been a while. Putting this on the Christmas wish list! :)

User avatar
kieranhj
Posts: 607
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby kieranhj » Sun Dec 17, 2017 9:20 pm

pixelblip wrote:I was thinking just now it would be ace to see this converter as a windows app with drag and drop.
I wanted to use it again tonight but thought ' where do I start ' - as it's been a while. Putting this on the Christmas wish list! :)

Heh. It certainly crossed my mind and would be a lot more usable but it's been a long time since I did any proper Windows app programming. Unfortunately Christmas is the worst time since I do most of my hobby stuff whilst commuting on the train to work! I do want to revisit the image conversion at some point though, as I think it can be improved / tidied up, but there's a long list of projects ahead of it right now, sorry...
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby pixelblip » Sun Dec 17, 2017 9:49 pm

No problem Keiran I do understand............there is lots to do always...........
For now it's not a big deal.........maybe someone else could cobble it together who knows a bit of windows programming.

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Image2Mode7 - general image to teletext converter

Postby pixelblip » Sun Dec 17, 2017 9:53 pm

No problem Keiran I do understand............there is lots to do always...........
For now it's not a big deal.........maybe someone else could cobble it together who knows a bit of windows programming.