Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Compressed 16 bit Bitmap for Xmega and SSD1963 Display - SD

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here
View previous topic :: View next topic  
Author Message
db3

Bascom Member



Joined: 18 Jan 2005
Posts: 7

blank.gif
PostPosted: Fri Jan 26, 2018 7:17 pm    Post subject: Compressed 16 bit Bitmap for Xmega and SSD1963 Display - SD Reply with quote

BGB Convertor
This program is a Windows program written in Visual Basic and must have
Net 4.0 installed. Install the BGB Convertor.exe into a directory you have
permission for, as temporary files are written and deleted.

The Picviewer.bas sample and BGB_SD.inc module are for a 16 bit SSD1963 Controller
type display (TFTM043-4). If you already have the library(by MRSHilov) and SD working for
your display,that's all you should need.

Converts most common picture files of any color depth to a compressed 16
bit color bitmap. Allows resizing up or down to any custom size desired.
Aspect ratio may be retained or picture can be stretched or shrunk for tweaking
to a precise size(or for effect). Pictures maybe flipped and rotated about all
four axis. BGB (Bascom Graphic Bitmap) files are similar to BGC files,
except with a much larger resolution capability and 16 bit color.
Included in this Package is an working library example for a SSD1963 Display
controller based on MRSHilov library. Could be modified for others.
BGB files are loaded from SD card (Requires AVR-Dos and MMC files).It
loads via SPI and should be nearly as fast as SPI ROM binary files. The BGB
file has no wasted bytes, the space savings depends on the amount of repeated
colors. Unfortunately it is unlikely we will ever see instant picture screens
with an AVR until they get a lot faster, or Displays start providing an extra
buffer. But even the best video makers use slide-ins!
NOTE! some PNG and GIF files have transparent pixels which cannot be
displayed as a bitmap.Check out the two Rubic Cubes included to see one
with and without transparency. This program will turn those pixels black. Or
you can convert them to a .tiff and it will then turn them white. Or you can
use a drawing program and overlay the .png on top of any other type picture,
and combine the two utilizing the transparent pixels. In fact entire full screen
overlays and backgrounds can be drawn in a drawing program, saved as a 24bit
bmp then converted to a 16 bit BGB file.

Usage is pretty much self-explanatory. When either the x or y axis is changed
with the Aspect checked will keep it in aspect. Uncheck when tweaking. Rechecking
the aspect will follow the Y axis. 0 and 90 deg rotation with both horizontal and
vertical flipped produces 180 and 270 degree rotation. Any changes in aspect, flip
or rotation do not take effect until the resize button has been pressed. You may
make all the changes you want, and resize over and over in reference to the
original picture. The ORIG/BGB will allow you to compare Resizing quality.It will
always degrade some when resizing big changes, so try to find pictures that are close
to your aspect ratio (X/Y) and resolution for full screen display. Don't be surprised
if file sizes go up when resizing JPG's, they are highly compressed.
The final image BGB file will be saved when you press the Save to BGB button.

The screen display is not at actual resolution, to keep both large and
small pictures viewable. What shows on the screen is very close to what you will
get on the display quality wise. The form may be maximized or sized by the resize corner
drag to change picture display size on your computer screen for close examination.

Many thanks to the Genius and Generosity of people like MrShilov and others like him.
This program was written out of frustration trying to size pictures correctly,
do some fun stuff, and save program space on the AVR. I hope you find it useful!


DB3 - Jan 2018
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4600
Location: Holland

blank.gif
PostPosted: Sat Jan 27, 2018 2:45 pm    Post subject: Reply with quote

Hello DB3

Thank you for sharing your code and utility with us.
The end result looks simple enough and it seems to work well Very Happy

_________________
Best regards,

Mark Alberts
MCS Electronics

http://www.mcselec.com
Back to top
View user's profile Visit poster's website
db3

Bascom Member



Joined: 18 Jan 2005
Posts: 7

blank.gif
PostPosted: Mon Feb 12, 2018 8:00 pm    Post subject: BGB Viewer Reply with quote

Wow, lots of Graphic formats available now. BGB,BGC,BGF,BGL, Binary and possibly
more. All fill a particular need. The BGB file is better suited for SD or flash
rom due to every pixel being 2 bytes. The RLE Compression helps save space and
speeds up display, but gets too large for internal storage with much size. The
advantage is the RGB565 color and the compression also helps increase display
speed. Have included a revised BGB Convertor (1.2 - fixed a couple of minor
cosmetic issues) and a BGB viewer which decompresses and reassembles the BGB
file like a display does to verify proper Conversion function. BGC libraries
can be modified relatively easy to BGB by basically doubling data.

DB3
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum