avaneev / avir Goto Github PK
View Code? Open in Web Editor NEWHigh-quality pro HDR image resizing / scaling C++ library, including a very fast, precise, SIMD Lanczos resizer (header-only C++)
License: MIT License
High-quality pro HDR image resizing / scaling C++ library, including a very fast, precise, SIMD Lanczos resizer (header-only C++)
License: MIT License
It seems you're using MMX intrinsics that can't be used within 64-bit code. You would need to use the SSE equivalents. Can you fix it?
first of all, your code is very excellent, i want to use your code , let it run on ARM CPU, for example, A53, but it is very SLOW!, so ,can you optimize this code on ARM CPU? Best My Regards!
Thank you for sharing this great resizing library! Results look so good!
Now I would like to get it a little faster using multithreading, but I don't know how. In your documentation I found class CImageResizerThreadPool... is this the right class for multithreading? Unfortunately I have no idea how to use it. Could you please share a small example, how to realize multithreaded resizing with your library? Thanks in advance for your help!
It's difficult to talk about "high quality images" with quite destructive image formats such as jpg and png.
I suggest adding DNG support.
Hi I'm trying to understand how the algorithm works. I have some questions...
Hello. The repo contains binary files for an image resizer tool. Is the source code for it available?
Hi, Can you please provide an example of how to use this code? Maybe you can use "imresize.exe" as a test case.
Hello again, Aleksey :)
I tried to compile with the AVX optimized version of float8 data type, but failed.
MinGW/GCC throws the error:
error: inlining failed in call to always_inline '__m256 _mm256_set1_ps(float)': target specific option mismatch 1310 | _mm256_set1_ps (float __A)
| ^~~~~~~~~~~~~~
avir_float8_avx.h:50:26: note: called from here
50 | : value( _mm256_set1_ps( s ))
SSE compiles good.
For AVX, I've tried all posible compiler options, but failed.
Do you know how to fix it?
I just ran into this project, but immediately got turned off by custom license. Any license requires some lawyer involvement, but custom licenses are the most difficult to adopt.
Could you consider changing it to something that's widely used?
https://opensource.org/licenses/category
This is up to you, but if I may suggest permissive licesnse like MIT, BSD, or Apache. :)
https://en.wikipedia.org/wiki/Permissive_software_licence
Thanks!
It doesn't seem to work when I go to scale the image while reading in the file?
How can I read a local image and save it locally after scaling?
Is an InBuf a file stream, and is an OutBuf a stream containing the entire image file header?
I can't seem to write it this way
#include <iostream>
#include <vector>
#include <fstream>
#include "avir.h"
int main() {
avir::CImageResizer<> ImageResizer(8);
uint8_t* file_source = new uint8_t[1920 * 1080 * 3];
uint8_t* out_source = new uint8_t[1920 * 1080 * 3];
memset(file_source, 0, 1920 * 1080 * 3);
memset(out_source, 0, 1920 * 1080 * 3);
std::ifstream file(R"(D:\Wallpaper\001.jpg)", std::ios::in | std::ios::binary);
std::uint64_t file_size = 0;
if (file.is_open())
{
file.seekg(std::ios::beg, std::ios::end);
file_size = file.tellg();
file.seekg(std::ios::cur, std::ios::beg);
file.read((char*)file_source, file_size);
file.close();
}
ImageResizer.resizeImage<uint8_t, uint8_t>(file_source,1920,1080,0, out_source,480,270,3,0);
delete[] file_source;
std::ofstream outFile(R"(.\1.jpg)", std::ios::out | std::ios::binary);
if (outFile.is_open())
{
outFile.write((char*)out_source, 1920 * 1080 * 3);
outFile.close();
}
delete[] out_source;
return 0;
}
Thanks for your work. Would you add rotation function in the toolkit ? such as affinetransform.
This looks like a great method. is there any document that define the method clearly? or as it implies that the method implements a 18-tap windowed sinc interpolation?
would appreicate if there are graphs/illustrations showing the detailed method.
First of all, thank you so much for giving us this incredible library. I can't believe it's free and open-source considering it's top-notch quality. Output results look amazing, speed is mind-blowing and the interface is as simple as it can get. Again can't thank you enough for this.
I'm creating an Image Processor for android. Tho the library itself is amazing, I would like to implement my own version of the algorithm to be used in my application. Mainly for the following reasons.
So my questions are,
In this testcase https://people.freebsd.org/~yuri/avir-testcase.tgz the scaled image that was represented as floats has green and pink pixels that weren't present in the original image.
Scaling in uint8 doesn't have this problem.
Please uncomment typedefs in the attached testcase to reproduce damaged and undamaged output cases.
Thank for sharing the code.
I’m using the Qt Library and QImage class. I would try to see if ImageResizer.resizeImage is better than the QImage:scaled https://doc.qt.io/qt-5/qimage.html#scaled.
I have no idea on how image format and buffers works.
I wonder if it is possible to use the library with the QImage format and if there are examples for
Speed is not an issue.
It seems the conversion sRGB <-> linear takes a large portion of the time spent.
On my i7 7700 (using msvc, full opt, SSE2), resizing our 30MPx sRGB test photo to about 1/12th of its size takes 650ms on average, applying gamma correction. Without gamma correction, it takes 200ms. Approximating the gamma correction with sqrt(2) takes 220ms (but isn't correct of course).
Do you think the performance of this part of your amazing algorithm could be improved?
Hello Aleksey,
I have a question regarding how to use your scaling algorithm with Blend2D library: https://github.com/blend2d/blend2d
The Blend2D API provides a way to use custom-defined windowing functions to use for scaling like Lanczos, Blackman and many more.
Could you please guide me how to involve your library properly to provide a windowing function that does scaling using your algorithm?
Thanks,
Arlen.
Sir, thank you for such a great API.
I was wondering how to add --algparams=ultra to the code, I was able to add to the command line only.
Thank you.
Is there a way to set a "progress callback function" either before or when invoking CImageResizer::resizeImage()?
I would like to show a progress control in my program while AVIR is resizing a large image. Went looking for a callback in AVIR that would indicate progress while resizing, can't see anything.
Is there a progress reporting method available?
Thanks!
Hi
Could you also provide sources for those binary CLI tools?
First of all thanks for this amazing project!
I am doing my first tests with it, and I was wondering why the resizeImage
method has a SrcScanlineSize
arguments, but not a DstScanlineSize
?
Best regards,
Peter
Not really an issue, but it would be great to have any performance numbers listed in the description/readme. I just tried to use it for real-time processing and, well, it's not fast :)
While testing the limit of this app (exe, not the C++ code), I noticed that : for one (and not for an other) of my big size png image at 14400x20656 (119MB vs 97,8MB), if I try to resize with scale 4 (=>3600x5164) the exe crash without error reported. After some reseach on this issue, I tried to "patch" the exe with 4GB Patch (https://ntcore.com/?page_id=371) and it no longer crashes.
I don't know if this is normal, but i report it just in case
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.