3 ms·
The article buried the lead, so here's your TLDR summary: - GIMP & Photoshop use the same O(n²) algorithm - GIMP's implementation is single threaded, while ph
by josho 10y ago
The article buried the lead, so here's your TLDR summary:
- GIMP & Photoshop use the same O(n²) algorithm
- GIMP's implementation is single threaded, while photoshop's is multithreaded and therefore performs much faster on modern multi-core CPUs
- Photopea uses a different algorithm with O(n) characteristics
- O(n) in a single threaded javascript is faster than O(n²) in parallel C/C++ for large values of n
- For photo editing, we used to work with relatively small photos, so algorithm choice didn't matter so much. But with modern digital cameras algorithm choice matters as we are seeing photo filters now working with larger values of n (pixel radius in this case).
Therefore, choosing the right algorithm matters.
- IvanK_net 10y agoNot exactly. I wanted to avoid too much scientific notation. - GIMP uses Θ(n * r²) algorithm - Photoshop uses Θ(n * r) algorithm - r<=10: Photopea uses Θ(n * r) algorithm - r> 10: Photopea uses Θ(n) algorithm with a large linear coefficient For r<=10 Photopea and Photoshop use the same algorithm. PP is slower not only because of Javascript, but also because of multithreading in PS.
- rocky1138 10y agoWould you consider porting your implementation to GIMP? I'm sure the community would love to see it.
- IvanK_net 10y agoActual implementation has about 50 lines of code. But I am afraid it would take me hours or days to install sources and compiler and to get into the structure of the GIMP code. BTW. I think my method corresponds to this: http://registry.gimp.org/node/24208 http://registry.gimp.org/node/24208