.PIC images

Anything QL Software or Programming Related.
Derek_Stewart
Font of All Knowledge
Posts: 3975
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: .PIC images

Post by Derek_Stewart »

Hi,

Nice graphics programme, but I really wanted a programme that runs on the QL, not Windows or Linux.


Regards,

Derek
Dec
ROM Dongle
Posts: 21
Joined: Sun Dec 20, 2020 2:28 pm

Re: .PIC images

Post by Dec »

XorA wrote: Wed Mar 29, 2023 9:49 pmDarn, if I had known of that tool I probably would have never written mine!
It was introduced in 2020: viewtopic.php?t=3574


User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Re: .PIC images

Post by dilwyn »

Dec wrote: Thu Mar 30, 2023 10:22 am
XorA wrote: Wed Mar 29, 2023 9:49 pmDarn, if I had known of that tool I probably would have never written mine!
It was introduced in 2020: viewtopic.php?t=3574
Wow, how did I miss that in 2020? No recollection of that thread at all. Unlike me to miss a genuinely useful software like that. Will add it to my website.

Edit:(probably because I read Forum posts with Blogtrottr which sends posts by email to my Inbox. While it works well most of the time, and it's very convenient, it has occasional periods where it fails to send anything then restarts after a day or two, or nothing happens for a while then it all catches up with several at once).


User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Re: .PIC images

Post by dilwyn »

Dec wrote: Thu Mar 30, 2023 10:22 am
XorA wrote: Wed Mar 29, 2023 9:49 pmDarn, if I had known of that tool I probably would have never written mine!
It was introduced in 2020: viewtopic.php?t=3574
Hello Dec,
I wonder if it would be possible to add QL PIC files to the list of output formats for DaDither.exe ?

This would allow variable size QL graphics files without the need to fit, stretch or centre the source file if it is not 512x256 pixels. In other words, graphics files can be any size, not just 512x256 pixels.

The file format for QL PIC files is described below, in case you need the info.

The graphics pixels are stored the same as the QL screen, but the file has a 10 byte header before the graphics:

$4AFC (decimal 19196) ;file ident
word number of pixels across
word number of pixels down
word line increment (bytes from start of one line to another)
byte screen mode number for this screen (0 for 4 colour mode, 8 for mode 8, 16 for mode 16/8-bit colour, 32 or 33 for 16-bit colours)
byte spare byte, not used in PIC files.


Dec
ROM Dongle
Posts: 21
Joined: Sun Dec 20, 2020 2:28 pm

Re: .PIC images

Post by Dec »

dilwyn wrote: Fri Apr 07, 2023 2:31 pmI wonder if it would be possible to add QL PIC files to the list of output formats for DaDither.exe ?
DaDither already uses PIC format for GD2 16/GD2 32/GD2 33 modes. If you want me to add PIC formats for QL 4/ QL 8 modes then provide me a sample of such images.


User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Re: .PIC images

Post by dilwyn »

Dec wrote: Fri Apr 07, 2023 2:45 pm
dilwyn wrote: Fri Apr 07, 2023 2:31 pmI wonder if it would be possible to add QL PIC files to the list of output formats for DaDither.exe ?
DaDither already uses PIC format for GD2 16/GD2 32/GD2 33 modes. If you want me to add PIC formats for QL 4/ QL 8 modes then provide me a sample of such images.
Thank you for replying so quickly.
I have attached 4 QL PIC files in both mode 4 (_pic4 file ending) and mode 8 (_pic8 file ending), together with the source jpeg files. One of the pictures (tiger.xxx) will be larger than the usual 512x256 QL image.
Attachments
pics.zip
PIC and JPG files for Dec
(368.02 KiB) Downloaded 35 times


Dec
ROM Dongle
Posts: 21
Joined: Sun Dec 20, 2020 2:28 pm

Re: .PIC images

Post by Dec »

dilwyn wrote: Fri Apr 07, 2023 3:19 pmI have attached 4 QL PIC files in both mode 4 (_pic4 file ending) and mode 8 (_pic8 file ending)
Could you also provide a rendering of your pic image. I mean how do they look on your QL monitor?
It looks like that the pixel encoding method in pic8 files is different from that of standard SCR8 files. This is true?


User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Re: .PIC images

Post by dilwyn »

Dec wrote: Fri Apr 07, 2023 5:14 pm
dilwyn wrote: Fri Apr 07, 2023 3:19 pmI have attached 4 QL PIC files in both mode 4 (_pic4 file ending) and mode 8 (_pic8 file ending)
Could you also provide a rendering of your pic image. I mean how do they look on your QL monitor?
It looks like that the pixel encoding method in pic8 files is different from that of standard SCR8 files. This is true?
I hope this is what you mean? I rendered them on a QL-compatible display in QPC2 (mode 4 and mode 8)
Mode 8 PIC files pixel encoding isn't different to mode 8 scr files. Just the line length varies. I wonder if they might be byte-reversed, as the emulator is running on a Windows/Intel system?

The PIC files were made with David Westbury's Photon software for QL systems.

The "tiger..." renders aren't fully displayed, the viewer I used for rendering isn't able to display a big enough image, hence the pan/scroll bars. All images are shown with top left corner visible.
render.zip
Files for Dec
(582.04 KiB) Downloaded 38 times


Dec
ROM Dongle
Posts: 21
Joined: Sun Dec 20, 2020 2:28 pm

Re: .PIC images

Post by Dec »

dilwyn wrote: Fri Apr 07, 2023 3:19 pmI have attached 4 QL PIC files in both mode 4 (_pic4 file ending) and mode 8 (_pic8 file ending)
I don't fully understand some of the details.

Lets compare internal file header structure of astronaut.pic4 and astronaut.pic8.

astronaut.pic4:
Width: 330
Height: 294
BPL: 84
Mode: 0
Spare: 0

Mode 4 has 2 bits/pixel, so minimal data size in bytes: (330 * 2 + 7) / 8 * 294 = 24402 bytes. Actual file size: 24706 bytes
Everything is OK.

astronaut.pic8:
Width: 332
Height: 294
BPL: 84
Mode: 8
Spare: 0

Mode 8 has 4 bits/pixel, so minimal data size in bytes: (332 * 4 + 7) / 8 * 294 = 48804 bytes. Actual file size: 24706 bytes
Everything is NOT OK. It look like that actual image width is Width/2 but is it documented somewhere?


Dec
ROM Dongle
Posts: 21
Joined: Sun Dec 20, 2020 2:28 pm

Re: .PIC images

Post by Dec »

dilwyn wrote: Fri Apr 07, 2023 6:58 pmI rendered them on a QL-compatible display in QPC2 (mode 4 and mode 8)
Could you provide renders in PNG or BMP format. Jpeg images have compression artifacts and I can't see all the pixels. I don't need all the images. I will be satisfied with one render of the mode 4, and one render of the mode 8.


Post Reply