To quote the online manual:
QuoteLOADSPRITE bmp$, num%
Loads the graphic file (bmp or png) into memory for using it with DRAWSPRITE commands later on. Every loaded sprite needs a unique ID number (num%) which allows you to access the sprite. If an ID is reused, the image in memory for that ID will be replaced by the new image.
Now I've read apparent comments that JPEG support had been added, but that it tended to cuase problems - I really want to be able to use JPEGs. Please?
Don't we all (well some of us). :(
There are some advantages to JPG. For example, in casual Hidden Object games that have lots of full screen backgrounds, huge "sprites" etc. it's sensible to use JPG. In fact almost all casual frameworks support it.
Sometimes is acceptable to have slightly lossy images but with the benefit of much smaller game download. JPG at 95% quality is still way smaller than PNG, without apparent degradation in quality.
Also, textures for 3d models mostly don't have to be losless, due to the way they're displayed on screen.
Also, in my instance many 3D models in .OBJ format have .jpg textures. If I supply a program to someone I doubt they will want to convert all their textures to .png and fix the references to go to the .pngs before using whatever I could write to use them :(
I'm surpriseed no-one has written a user function to read JPEGS - is the file format not available, or really convoluted?
Can "we", as a user group, find the jpeg spec and write a reader (as I'm currently attempting with .OBJ files)? I don't know how into "group helping and sharing" we are here, yet. I'll learn!
You can try to load jpeg on Win32. On most platforms it works - iPhone does for sure _not_.
I am aware of that bug, but so far I can't get it fixed as it's a different library I have to use.
Cool - I'll try it on Win32 a bit later. Personally I don't need iPhone support yet but was nervous about jpeg as it doesn't seem to be documented and the forum posts I found seemed to suggest it was, ah, flakey?
JPEG doesn't work properly EVEN on Windows, I'm afraid.
It might load one or more images once, but try to use them more than once and/or other images and it all fecks up.
I brought this up ages ago, as I was working on a Top Trumps game and wanted the card images to use JPEG. It seems fine at first, but goes awry very quickly when JPEGs are loaded and displayed.
:( thanks Ian, I had a horrible feeling that's what I'd found - so jpeg support is back on my list of things to consider trying to write. Ah well! :|
As it causes immense problems, I dont see it being in for quite a while.
At the moment you can only use it with one file - any further use (especially to the same id number) will crash your program...
I must admit, I had hoped that someone would ahve taken a similar approach to my initial thoughts on the .obj file format - and started tackling the .jpeg file format in GLBasic from first principles. Possibly even converting from C source code freely avaiable at site slike:
http://www.ijg.org/ (http://www.ijg.org/)
or
http://www.faqs.org/faqs/jpeg-faq/part1/index.html (http://www.faqs.org/faqs/jpeg-faq/part1/index.html)
(links very quickly obtained via google).
I have slightly fond memories of using a version of FORTH which had been written and compiled in an earlier version of FORTH, and have wondered whether producing our own 2libraries" might be something the community was "up for" on a collective basis - there certainly seem to be some code snippets along those lines. Maybe those who post their code thend not to be those interested in 3D or different graphic formats?
The ability to load raw image data to a sprite has only been available for a few days, hold your horses :-)
Apparently Gernot is using the jpeg code from http://www.ijg.org/ - but its being a problem...
I can wait a bit. Even without days like today when my head's splitting too much to code, I've got a fair few bits and pieces to put together and test out. Plenty of refining before I NEED good .jpeg support - though I fear I have lost sight of the prudence I intended to have when approaching GLB to eval :(
QuoteJPG at 95% quality is still way smaller than PNG, without apparent degradation in quality.
I must be the only one who prefers PNGs because they almost always seem to be smaller than JPGs with better quality. That's why I typically only use PNGs for web design. After a certain size a JPG might be smaller, but for mostly what I've done PNG has been smaller.
QuoteAfter a certain size a JPG might be smaller, but for mostly what I've done PNG has been smaller.
Smaller is a relative term and means bugger all, really.
Given the same image in three formats a PNG when uncompressed might appear smaller than a .JPEG or .BMP, but when compressed in a .ZIP file, is likely to be larger. And whilst occupying memory, each image will be the same.
There's no disagreement here, actually. I personally find them preferable to .jpg, given a choice, and while generalisations are dangerous (it's often possible to disprove a generalisation with a very specific, perhaps unlikely, example) I find .png files tend to be smaller "live" than a .jpg file which isn't visibly poorer.
Which is great, for "live" use asuch as on the web.
Ian (and I think others) however are saying that .jpg files compress further in .zip or .rar form, so that - in a compressed archive (such as a game bundled with graphics and sound) .jpgs of visibly similar (possibly "identical" to the eye) quality actually end up taking less space - which makes them lighter to download. which is a good thing, overall.
It's all horse for courses - there's no "one good way" to do everything, each method/type has its pros and cons :)
I kent, tes normally this occurs when the size exceeds I think 1000px
Hi KentM, this is your first post and you registered today.
You are offering a "free tool" as a solution to a problem after investigation and experimentation.
It may be more polite to share some of this investigation and experimentation with jpegs and GLB and how far it goes, like multiplatform etc.
No harm intended and I apologize for my behavior, but the way it is, it sounds like spam on my book. :doubt:
I have removed KentM's message as -
a) It was responding to a post over two years old
b) It wasn't really relevant
c) It was indeed a means to advertise a product.
d) If it was a genuine first post it was crap.
Thanks for reporting fellas :)
Quote
d) If it was a genuine first post it was crap.
+1
Lee
Sent from my GT-I5700 using Tapatalk 2