amarok Posted September 1, 2020 Share Posted September 1, 2020 I would like to present my first program which I wrote using MadPascal. gr9Lab is an application designed for image processing on 8-bit Atari computer. The program is still under development but it contains almost all functionalities planned so far. I tested the application under Altirra and I cannot guarantee that it works on a real hardware. The current version should properly work with 64kB of memory. Below you can find the link to the YouTube video. It is possible to work with two images in GR9 mode with resolution of 80x192 pixels at the same time. The program has ability to process the whole images or within a selected rectangular area of interest (ROI). The program can be controlled by joystick or the keyboard: by pressing 1 and 2 keys you can switch the view between two images. by pressing Tab/Shift Tab keys you can go to the next/previous menu item or other GUI control. by pressing Return key you can activate highlighted menu item or other GUI control. by pressing Esc key you can go to the main menu. The list of features available in the current version contains as follows. gr9Lab menu New - clears content of the image. Load - loads image from a file in GR9 format (80x192 pixels). Save - saves image to file in GR9 format (80x192 pixels). Exit - closes the application. Copy - copies image content from the other one. Show/Hide selection - turns on/off selection (ROI). Process menu Flip horizontal - performs mirror of the image in horizontal direction. Flip vertical - performs mirror of the image in vertical direction. Rotate 180 - rotates the image by 180 degrees. Brightness/Contrast - adjusts brightness and contrast of the image. Histogram - calculates and shows a histogram of the image. Histogram equalize - performs histogram equalizaion on the image. Inverse - applies inversion of pixels intensity. Threshold - performs thresholding operation, pixels replaced by black if are darker than parameter or replaced by white otherwise. Add noise - applies random modification of pixels intensity. Filter menu Box filter - applies average filter of 3x3 pixels on the image. Gaussian blur - applies Gaussian blur filter of 3x3 pixels on the image. Sharpen - performes sharpening operation using filter of 3x3 pixels. Laplace edges - enhances edges on the image by Laplace filter of 3x3 pixels. Emboss - generates relief effect on the image by using filter of 3x3 pixels. Dilate filter - applies morphological dilate filter of 3x3 pixels on the image. Erode filter - applies morphological erode filter of 3x3 pixels on the image. Opening filter - applies morphological opening filter of 3x3 pixels on the image. Closing filter - applies morphological closing filter of 3x3 pixels on the image. Math menu Set - fill the image by a selected intensity. Add - increases pixels intensity by selected value. Subtract - decrease pixels intensity by selected value. Difference - calculates absolute difference between pixels intensity and selected value. Multiply - multiplies pixels intensity by selected value. Divide - divides pixels intensity by selected value. Log - calculates logarithm values from pixels intensity. Exp - calculates exponent values from pixels intensity. Sqr - calculates power of 2 from pixels intensity. Sqrt - calculates square root from pixels intensity. Not - calculates bitwise negation of pixels intensity. Or - calculates bitwise sum of pixels intensity and selected value. And - calculates bitwise product of pixels intensity and selected value. Xor - calculates bitwise exclusive disjunction of pixels intensity and selected value. Minimum - calulates minimum value from pixels intensity and selected value. Maximum - calulates maximum value from pixels intensity and selected value. Blender menu Add - calculates addition between corresponding pixels of two images. Subtract - calculates subraction between corresponding pixels of two images. Difference - calculates absolute difference between corresponding pixels of two images. Multiply - calculates multiplication between corresponding pixels of two images. Divide - calculates division between corresponding pixels of two images. Average - calculates average value between corresponding pixels of two images. Or - calculates bitwise sum between corresponding pixels of two images. And - calculates bitwise product between corresponding pixels of two images. Xor - calculates bitwise exclusive disjunction between corresponding pixels of two images. Minimum - calculates minimum from corresponding pixels of two images. Maximum - calculates maximum from corresponding pixels of two images. My plan for further improvements of the program contains at least the following items: using extended memory for storing more than 2 images. introduction of undo operation. improvements of load/save operations - better error handling, introduction of file explorer. showing the name of visible image and information if the image has been modified and is unsaved. introduction the screen with help and settings (I have some ideas for settings). support of Atari 800 (currently I have problem with proper keyboard handling by ReadKey function). solve a problem with computer crash after aplication is closed. You can download the disc image or standalone executable and play with the application freely. I would be grateful for your comments. gr9Lab_WIP1.atr gr9Lab_WIP1.xex 31 11 Quote Link to comment Share on other sites More sharing options...
tane Posted September 2, 2020 Share Posted September 2, 2020 (edited) Very nice this "Photoshop" as a retouching program. Several good features included. I think, however, that the most crucial and the very first step, which is to convert any high-res jpg to a good pixelated image suitable for 8-bits, from a squared pixel to a rectangular-horizontal pixel for Atari, with a good contrast, and likely by a Windows program due to hardware requirements, it's still missing in some way. It's very difficult and also an "entry barrier" to generate a starting point for Atari with rectangular pixels, for then do the retouching. Edited September 2, 2020 by tane 1 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted September 2, 2020 Share Posted September 2, 2020 That's absolutely fantastic! 1 Quote Link to comment Share on other sites More sharing options...
jamm Posted September 2, 2020 Share Posted September 2, 2020 Really amazing work - thank you! This really would benefit from mouse or tablet support, if you can squeeze that in. 2 1 Quote Link to comment Share on other sites More sharing options...
Voxel Posted September 2, 2020 Share Posted September 2, 2020 I'm just amazed - thank you! 1 Quote Link to comment Share on other sites More sharing options...
amarok Posted September 3, 2020 Author Share Posted September 3, 2020 Thank you very much for your comments. I am glad you like it. In the link below you can find source codes of the project. Nothing special, but maybe for someone will be inspiring... https://gitlab.com/amarok8bit/gr9Lab There you can find also a python script which I am using for conversion from png to gr9 image format. 5 2 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted September 3, 2020 Share Posted September 3, 2020 35 minutes ago, amarok said: Thank you very much for your comments. I am glad you like it. In the link below you can find source codes of the project. Nothing special, but maybe for someone will be inspiring... https://gitlab.com/amarok8bit/gr9Lab There you can find also a python script which I am using for conversion from png to gr9 image format. Thanks for sharing! Quote Link to comment Share on other sites More sharing options...
Irgendwer Posted September 3, 2020 Share Posted September 3, 2020 (edited) 4 hours ago, amarok said: There you can find also a python script which I am using for conversion from png to gr9 image format. "Atari Graphics Studio" which you can find here: http://madteam.atari8.info/index.php?prod=uzytki is also able to produce this format, has a broader support of input file formats and some nice conversion options. (Which only partly contradicts the native processing of "gr9Lab"... (nice job, BTW) ) Edited September 3, 2020 by Irgendwer 1 Quote Link to comment Share on other sites More sharing options...
amarok Posted September 7, 2020 Author Share Posted September 7, 2020 "Atari Graphics Studio" is indeed a quite powerfull application. Thanks for the recommendation. In the meantime I prepared WIP demo 2 of gr9Lab. In this version there are following changes: Added settings menu. Added support for Atari ST mouse and Amiga mouse. Added shortcuts for menu items. Added option for faster image processing by turn the display off. You can check how Atari ST mouse works in the application on the video below: I attached the latest disc image and executable. gr9Lab_WIP2.atr gr9Lab_WIP2.xex 10 2 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted September 7, 2020 Share Posted September 7, 2020 41 minutes ago, amarok said: "Atari Graphics Studio" is indeed a quite powerfull application. Thanks for the recommendation. In the meantime I prepared WIP demo 2 of gr9Lab. In this version there are following changes: Added settings menu. Added support for Atari ST mouse and Amiga mouse. Added shortcuts for menu items. Added option for faster image processing by turn the display off. You can check how Atari ST mouse works in the application on the video below: I attached the latest disc image and executable. gr9Lab_WIP2.atr 90.02 kB · 1 download gr9Lab_WIP2.xex 34.22 kB · 1 download Was it difficult to add mouse support? Quote Link to comment Share on other sites More sharing options...
amarok Posted September 8, 2020 Author Share Posted September 8, 2020 @Stephen, mouse support seems to be relatively easy task. It is required to check a specific sequence of signals on particular pins of joystick port. I used the following documentation (unfortunately it is written in Polish): Atari ST: http://atariki.krap.pl/index.php/STM1 Amiga: http://atariki.krap.pl/index.php/Mysz_do_Amigi You can also check my implementation in procedure MoveMouseCursor located in the following source file: https://gitlab.com/amarok8bit/gr9Lab/-/blob/master/source/cursor.pas#L216 In the meantime I prepared a short video containing results of image processing time. This simple benchmark compares PAL and NTSC systems in normal and fast mode when display is turn on and off respectively. 4 1 Quote Link to comment Share on other sites More sharing options...
Mathy Posted September 8, 2020 Share Posted September 8, 2020 Hello guys You can find some mouse detect code and the story of how it works and how it was invented in English on my special stuff page. Sincerely Mathy 1 1 Quote Link to comment Share on other sites More sharing options...
Ute Posted September 9, 2020 Share Posted September 9, 2020 This is really great work! 1 Quote Link to comment Share on other sites More sharing options...
manterola Posted September 9, 2020 Share Posted September 9, 2020 This is a fantastic piece of software!!! Now regarding ponting device support, Missile Command trackball mode (which I use with both CX22 and CX80) also supports Atari ST Mouse. So that make me wonder that adding trackball support (in the missile command way) will make the application to support Atari ST mouse as well. 1 Quote Link to comment Share on other sites More sharing options...
amarok Posted September 9, 2020 Author Share Posted September 9, 2020 (edited) @manterola, it is very good idea to support trakball. I've just implemented this functionality and roughly checked in Altirra. But could you please test it on the real hardware? https://gitlab.com/amarok8bit/gr9Lab/-/blob/master/gr9Lab.atr https://gitlab.com/amarok8bit/gr9Lab/-/blob/master/gr9Lab.xex To activate the trakball support you have to change Controller to Trakball in the Settings menu. Thank you very much for your help. ? Edited September 9, 2020 by amarok 6 Quote Link to comment Share on other sites More sharing options...
manterola Posted September 25, 2020 Share Posted September 25, 2020 On 9/9/2020 at 12:29 PM, amarok said: @manterola, it is very good idea to support trakball. I've just implemented this functionality and roughly checked in Altirra. But could you please test it on the real hardware? https://gitlab.com/amarok8bit/gr9Lab/-/blob/master/gr9Lab.atr https://gitlab.com/amarok8bit/gr9Lab/-/blob/master/gr9Lab.xex To activate the trakball support you have to change Controller to Trakball in the Settings menu. Thank you very much for your help. ? Hi @amarok, I was finally able to spend a bit of time with your great program. The Trackball works, but i have some observations: - I could not change the controller in the setup,using only the keys. I tried that since I already had the trackball plugged. Finally i plugged a joystick and change the controller selection by using that joystick, the I replugged the trackball - Once you change controller, the setting are activated immediately,so the pointer started jumping around. It should apply the changes after the OK. - Finally, the trackball works pretty "slow",I guess you need to apply a "factor" to compensate for the low resolution of the trackball. Thanks for this great piece of software. 1 1 Quote Link to comment Share on other sites More sharing options...
amarok Posted September 28, 2020 Author Share Posted September 28, 2020 I've prepared a small upgrade of the gr9Lab. In WIP 3 demo version there are following changes: support for Atari Trakball, possibility for changing controller port (available in Settings menu), support for Atari 800 keyboard, settings are changed after closing the Settings menu by selecting OK button. @manterola I'd like to thank you for checking gr9Lab with the real trackball. Your feedback was very helpful. Quote Finally, the trackball works pretty "slow",I guess you need to apply a "factor" to compensate for the low resolution of the trackball. I think that the trackball has enough good "resolution" and there was a completely different problem. I used STICK0 $0278 (the shadow register) for checking the trackball status instead of PORTA $D300 (the hardware register). It is obvious that state of the shadow register is updated 50 or 60 times per second for PAL or NTSC respectivelly during vertical blank. And this is to slow for handling the trackball. So that was the actual reason of the poor response of the software for trackball movements. Regarding the keyboard and Atari 800: gr9Lab is written in MadPascal and I use ReadKey function for checking which key on the keyboard is pressed. This function uses a convertion table located in ROM for translation of the keyboard code into ATASCII. Unfortunately in Atari 800 this table is missing (or at least I couldn't find it in ROM), therefore I had to provide it directly within the software. Finally gr9Lab should properly handle the keyboard of Atari 800. I would be grateful if someone could confirm it on the real hardware. gr9Lab_WIP3.atr gr9Lab_WIP3.xex 5 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.