It can manipulate images stored on file system, but can it take in an image buffer?
Else, what other options or free SDKs can I use to manipulate an image buffer? In particular, rotation.
Take a look at ImageMagick -- it can take a buffer directly.
You didn't say what language/framework you use. For .NET look at Atalasoft's DotImage Photo, which is free (disclaimer: I work at Atalasoft).
Related
I can use D3DXCreateTextureFromFile to load an image, and D3DXSaveTextureToFile to save it, but how can I resize it? Should I use IDirect3DDevice9::SetRenderTarget and render to a texture?
Is it slower than doing it on CPU?
Generally you 'resize' images with the GPU by drawing them as a 'fullscreen quad' onto a render target set to the target size. Depending on the size and the data involved, it's probably slower to ship it over the GPU and then rely on readback to get it to disk so doing it on the CPU is usually the better approach. I believe the legacy deprecated D3DX9 utility library you are using can do the resize with D3DXLoadSurfaceFromSurface.
You should not be using Direct3D 9 and/or the legacy D3DX9 library for new projects. See MSDN and Living without D3DX
A better solution is to use the Windows Imaging Component directly to load the image, resize it, and save a thumbnail. See DirectXTex for extensive example code using WIC.
Is it possible to process(filter) HDR images through Core Image? I couldn't find much documentation on this, so I was wondering if someone possibly had an answer to it. I do know that it is possible to do the working space computations with RGBAh when you initialize a CIContext, so I figured that if we could do computations with floating point image formats, that it should be possible..
What, if it is not possible, are alternatives if you want to produce HDR effects on iOS?
EDIT: I thought I'd try to be a bit more concise. It is to my understanding that HDR images can be clamped and saved as .jpg, .png, and other image formats by clamping the pixel values. However, I'm more interested in doing tone mapping through Core Image on a HDR image that has not been converted yet. The issue is encoding a CIImage with a HDR image, supposedly with the .hdr extention.
EDIT2: Maybe it would be useful to useful to use CGImageCreate , along with CGDataProviderCreateWithFilename ?
I hope you have basic understanding of how HDR works. An HDR file is generated by capturing 2 or more images at different exposures and combining it. So even if there's something like .HDR file, it would be a container format with more than one jpg in it. Technically you can not give two image files at once as an input to a generic CIFilter.
And in iOS, as I remember, it's not possible to access original set of photos of an HDR but the processed final output. Even if you could, you'd have to manually do the HDR process and generate a single HDR png/jpg anyway before feeding it to a CIFilter.
Since there are people who ask for a CI HDR Algorithm, I decided to share my code on github. See:
https://github.com/schulz0r/CoreImage-HDR
It is the Robertson HDR algorithm, so you cannot use RAW images. Please see the unit tests if you want to know how to get the camera response and obtain the hdr image. CoreImage saturates pixel values outside [0.0 ... 1.0], so the HDR is scaled into said interval.
Coding with metal always causes messy code for me, so I decided to use MetalKitPlus which you have to include in your project. You can find it here:
https://github.com/LRH539/MetalKitPlus
I think you have to check out the dev/v2.0.0 branch. I will merge this into master in the future.
edit: Just clone the master branch of MetalKitPlus. Also, I added a more detailed description to my CI-HDR project.
You can now(iOS 10+) capture Raw images(coded on 12 bits) and then filter them the way you like using CIFilter. You might not get a dynamic range as wide as the one you get by using bracketed captures; nevertheless, it is still wider than capturing 8-bits images.
Check Apple's documentation for capturing and processing RAW images.
I also recommend you watch wwdc2016 video by Apple(move to the raw processing part).
I have a JPEG image stored in memory as a blob and am looking to apply some basic transformations to it (e.g. resize, convert to greyscale, rotate etc.)
I am currently using Google Scripts which doesn't have a native image library as far as I can tell.
Are there standard algorithms or similar which would allow me to work with the raw binary array, knowing it represents a JPEG image, to achieve such a transformation?
Not the answer you are looking for I guess, but...
To be able to do image processing using JPEG files as input, you need to decode the images. Well, actually, 90/180/270 degree rotation, flipping and cropping is possible as lossless operations, and thus without decoding the image data. But for anything more advanced, like resizing, you need to work with a decoded image.
Both the file structure (JIF/JFIF) and algorithms used to compress the image data in standard JPEG format are well defined and properly documented. But at the same time, the specification is quite complex. It's certainly doable if you have the time and know what you are doing. And if you are lucky, and your JPEG blobs are all written the same way, you might get away with implementing only some of the spec. But even then, you will need to (re-)implement large parts of the spec, and it might just not be worth it.
Using a 3rd party service to convert it for you, or create your own using a known library, like libjpeg or Java's ImageIO, etc. might be your best bets, if you need a quick solution, and don't have too strict requirements for performance.
There are no straightfoward image processing capabilities available in Apps Script. You'll have either expose your Python as a web service and call it from Apps Script or use the Drive REST API to access the files from your Python app or use any api webservices.
GAE Python has Image processing capabilities check the below url:
https://developers.google.com/appengine/docs/python/images/
Available image transformations
The Images service can resize, rotate, flip, and crop images, and enhance photographs. It can also composite multiple images into a single image.
I'm desperately in need of some software. What I'm looking for is some type of image editor that has support for pixel level manipulation by means of some type of scripting language (think HLSL/GLSL pixel shaders.)
Requirements:
Access to pixel data from script.
Support for 32-bit floating point images with alpha
Can read and write multiple file formats (TIFF, PNG, BMP...)
Does something like this already exist?
Adobe's PixelBender has some of this. So does Chrome. You didn't really specify a context, but... as an image editor, look into Pixel Bender.
I did a webgl shader that generate a procedural texture of about 8k * 4k. I need to save this texture to disk. I was wondering if there is some facility to do that. I know it would be possible to write a function that retrieve the texture by block and rebuild it in a 2d canvas to recontruct it, but before doing that I would like to be sure there is not other way.
Anyone ?
Check the File API and the File API Writer for HTML5, you must also keep in mind that your canvas must be untainted (read: no cross-origin images rendered) to read the pixels from it.
With the File API you must read the pixels and write them as a blob directly.