There are API's like ImageMagic that can do everything and make you a sandwich, but all I need to do is open a graphics file and access individual pixels. What is the simplest way to do this?
What is your graphics file extension (eg bmp, jpg, tif etc). The formats are very varied. With "any loss less format", we're none the wiser. Just pick one example format first.
But finding a library which does those 4, nothing more, nothing less will be hard work. For the simple reason that as soon as a library supports more than one format, the natural tendency for it is to support as many as possible (now we're back to ImageMagic).
The next problem you face is making sure that suitable libraries exist for your current/future operating system and compiler.
Also, with 4 different libraries, you're going to have 4 different APIs, with 4 different ideas as to what "a pixel" is. At least with IM you can just open the file and get a consistent look and feel from a programming point of view.
Next, are 4 file formats likely to become 5 or more formats in the future? If there is any chance of this, then go with IM (you should be already done). If not, you'll have quite a lot of work to add a new library, a new pixel format and so on.
I suppose it all boils down to where you want to invest your time.
--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.