Is there an easy way to remove the container from my ASTC 8x8 texture I have in a KTX file. I want to use ARM's astc-encoder tool to go from .astc -> .png but I only have the KTX file which is in ASTC 8x8 format
I would suggest you use the KTX SDK[1] to load the container and then save off the contained images as individual ASTC files. More info in the KTX forums[2].
https://github.com/KhronosGroup/KTX-Software
https://forums.khronos.org/forumdisplay.php/103-KTX-file-format-for-OpenGL-OpenGL-ES-and-WebGL-textures
Related
How can I load animated .gif file in an array of ID3D11ShaderResourceView on Directx11?
Windows Imaging Component (WIC) can load the individual 'raw frames' from an animated gif, but you have to compose them with the help of extra metadata. I recently implemented a mode in the DirectTex tool texassemble that creates a 2D texture array DDS flipbook from an animated gif. You can either use it as an offline solution (convert to DDS, then use DDSTextureLoader to load it at runtime), -or- review the code for an example of doing it yourself.
See texassemble.cpp and look at the function LoadAnimatedGif.
Is there a way to do this using fread/fwrite? I have the exact coordinates of the rectangle from the image I want to crop.
Most image files are more complex than just an array of pixels. They often contain headers with metadata and compress the image data in some way.
Editing them is often done with some sort of library, such as Magick++. These libraries contain classes and functions for
opening image files and reading in the image data
Modifying the image data with built-in functions, such as cropping, scaling, etc.
Getting access to the raw image data (often exposed as an array of pixels) so the programmer can modify it in ways not provided by the library.
saving image files
I personally recommend you CImg, an "small, open source, C++ toolkit for image processing". All you have to do is to include a header file, download it from http://cimg.sourceforge.net/, load the image from the file using the CImg library and then use the crop function.
How can I "draw"\"merge" a png top of another png (background) using libpng, while keeping the alpha section of the png being drawn on top of the backhround png. There does not seem to be any tutorials or anything mentioned in the documentation about it.
libpng is a library for loading images stored in the PNG file format. It is not a library for blitting images, compositing images, or anything of that nature. libpng's basic job is to take a file or memory image and turn it into an array of color values. What you're talking about is very much out of scope for libpng.
If you want to do this, you will have to do the image composition yourself manually. Or use a library that can do image composition (cairo, etc).
I need to load PNGs and JPGs to textures. I also need to save textures to PNGs. When an image exceeds GL_MAX_TEXTURE_SIZE I need to split the image into separate textures.
I want to do this with C++.
What could I do?
Thank you.
I need to load PNGs and JPGs to textures
SDL_Image
Qt 4
or use libpng and libjpeg directly (you don't really want to do that, though).
When an image exceeds GL_MAX_TEXTURE_SIZE I need to split the image into separate textures.
You'll have to code it yourself. It isn't difficult.
DevIL can load and save many image formats including PNG and JPEG. It comes with helper functions that upload these images to OpenGL textures (ilutGLBindTexImage, ilutGLLoadImage) and functions to copy only parts of an image to a new image (ilCopyPixels, can be used to split large textures).
For the loading part SOIL looks rather self-contained.
I am using artoolkit to create an augmented reality based project.I can load vrml 3d objects in the video feed using openvrml.
Now I wanted to load a bitmap or any other image file like jpg,png etc file on the marker in the video feed.How do I go about achieving this?
The usual approach is using an overlay.
Just make a VRML 'model' consisting of a single quad with a texture corresponding to your image file. Your existing VRML machinery should take care of the rest.