------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 Summary: resize really bad qualitatively Product: digikam Version: unspecified Platform: SuSE RPMs OS/Version: Linux Status: NEW Severity: normal Priority: NOR Component: general AssignedTo: digikam-devel kde org ReportedBy: tibirna kde org Version: 0.9.2-final (using KDE KDE 3.5.5) Installed from: SuSE RPMs I'm almost ashamed to report this, as it is more a wish than a bug and I can't hold forth nothing but qualitative observations in support. Digikam's resize functionality is really bad qualitatively compared to the resize function found in other programs (like GIMP). The problem sits in the really ugly jagged diagonal lines appearing after resizes in contours of highly contrasting images. No matter what options I choose in the cimg plugin's configurations, the jagging is immediately visible and almost insulting. Thanks for your understanding. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 arnd.baecker web de changed: What |Removed |Added ---------------------------------------------------------------------------- Component|general |Image Editor ------- Additional Comments From arnd.baecker web de 2007-11-12 09:19 ------- Hi Christian, I assume that you use the Image editor, "Transform/resize"? This is the same issue we discussed a couple of days on the IRC. Only if "Restore photograph" is ticked, cimg is used. Otherwise DImg::smoothScale() is used to resize image, http://websvn.kde.org/branches/extragear/kde3/graphics/digikam/libs/dimg/dimgscale.cpp?revision=675631&view=markup (the code comes frome imlib2 + 16 bits color depth support). User cryos (in the IRC) wrote that "It used to perform a lot better", but nothing has changed in the underlying code for ages. Therefore Gilles suspected: "perhaps it is a compilation option (optimization ?) used to compile digiKam which breaks something" This sounds like it needs a thorough investigation... _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Cristian Tibirna
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 ------- Additional Comments From tibirna kde org 2007-11-12 13:21 ------- Yes, the "Transform/Resize..." menu item from the editor. No matter if cimg is checked or not, the result is extremely jagged. Here is an example: Original (4.3 MiB!): http://cristian.tibirna.org/sandbox/dsc_0520.jpg Resized: http://cristian.tibirna.org/sandbox/dsc_0520_resized.jpg Really bad jagging can be seen in the resized one on the Python and Tkinter text and on the vertical (slanted) contour of the Python Programming book. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Cristian Tibirna
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 ------- Additional Comments From arnd.baecker web de 2007-11-12 13:33 ------- Yes, I can confirm the problem. It is really bad, and even worse for smaller output sizes. (and gimp does better, even without cubic interpolation ...) ((At least you seem to have the C++ books on your shelf as well to solve that issue on your own - sorry, couldn't resist ... ;-)) Gilles, can you reproduce the problem as well? _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Cristian Tibirna
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 ------- Additional Comments From fabien.ubuntu gmail com 2007-11-13 14:36 ------- Hi, I can confirm the problem as I already faced it in the past. This bug entry is also related to this one I think : http://bugs.kde.org/show_bug.cgi?id=149284 I don't think it's only about C++ coding but also about maths (algorythms used behind it). If you look at image processing softwares, they often have different possibilities for that (bilinear, bicubic, ...). If you look at krita, they have many different filters. Maybe digikam could "borrow" some code from Krita ? I think this is really important and will be more and more with this stupid Mpx race manufacturers still play (look at the latest 12 Mpx compact cameras). _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Cristian Tibirna
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 ------- Additional Comments From caulier.gilles gmail com 2007-11-13 14:46 ------- Fabien, the algorithm to resize image come from imlib2 and have been ported to digiKam core by Renchi Raju (he have added 16 bits color depth support and removed all assembler code to be more portable). This code is also used in Gwenview as well, without removing assembler code. If i remember Krita have planed to do it. Few portion of code have been also ported by Mosfet originally to Qt... Code is very complex... but very fast to render image on screen. Look here : http://websvn.kde.org/branches/extragear/kde3/graphics/digikam/libs/dimg/dimgscale.cpp?revision=675631&view=markup This code is used everywhere to render zoom and resizement. There is no plan to replace it. To have tried to understand how it's work, it's not simple. Of course, we can use another algorithm _only_ for image editor resize tool. I'm waiting your proposals for the better one (url to source code will be very appreciate) Gilles _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Cristian Tibirna
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 ------- Additional Comments From fabien.ubuntu gmail com 2007-11-13 18:17 ------- But, imlib code is just used to display pictures on screen, isn't it ? Or is the same code used to resize the picture in Image Editor and Kipi resize plugin ? I was talking (as the bug report) about resizing the picture to create a new file. My remark about the new cameras is because I think it's stupid to keep so big pictures, so it could be a good solution to resize them to something more convenient (in term of disk space, speed and quality), eg 6 Mpxels. About krita algorithms, it seems to be here : http://websvn.kde.org/trunk/koffice/krita/image/kis_filter_strategy.cc?view=markup see also http://websvn.kde.org/trunk/koffice/krita/image/kis_filter_strategy.h?view=markup _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Cristian Tibirna
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 ------- Additional Comments From fabien.ubuntu gmail com 2007-11-13 18:35 ------- Also found interesting pages : * image resizing : http://www.cambridgeincolour.com/tutorials/image-resize-for-web.htm http://www.cambridgeincolour.com/tutorials/image-interpolation.htm There are also some research papers on that, but maybe not so easy to understand and use :) _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Cristian Tibirna
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 ------- Additional Comments From fabien.ubuntu gmail com 2007-11-13 18:45 ------- From one research paper (A New Image Scaling Algorithm Based on the Sampling Theorem of...) Most popular resizing algorithms - nearest neighbour - bilinear algorithm - bicubic - Bell - Hermite - Mitchell, - Hanning - Gauss - Lanczos Photoshop uses interpolations based on bilinear, bicubic and nearest neighbour. Krita uses Mitchell, Lanczos, BSpline, Bell, triangle/bilinear and Hermite. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Cristian Tibirna
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 ------- Additional Comments From fabien.ubuntu gmail com 2007-11-13 18:52 ------- And finally last links : * The myth of infinite detail: Bilinear vs. Bicubic http://www.codinghorror.com/blog/archives/000367.html * Better Image Resizing http://www.codinghorror.com/blog/archives/000903.html << After some experimentation, I came up with these rules of thumb: * When making an image smaller, use bicubic, which has a natural sharpening effect. You want to emphasize the data that remains in the new, smaller image after discarding all that extra detail from the original image. * When making an image larger, use bilinear, which has a natural smoothing effect. You want to blend over the interpolated fake detail in the new, larger image that never existed in the original image. >> This is why I think we should have a choice of a few algorithms... _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Cristian Tibirna
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 ------- Additional Comments From fabien.ubuntu gmail com 2007-11-13 18:57 ------- Taken from Adobe coldfusion docs : Interpolation algorithms Interpolation algorithms let you fine-tune how images are resampled. Each algorithm balances image quality against performance: in general, the higher the image quality, the slower the performance. Quality and peformance differ based on image type and the size of the source file. The following table describes the algorithms and their named equivalents based on average test results: Highest image quality with low performance : lanczos Good image quality with slightly higher performance: mitchell, quadratic Medium quality image with medium performance : hamming, hanning, hermite Slightly distored image quality with high performance : blackman, bessel Poor image quality with highest performance : nearest, bicubic, bilinear _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Cristian Tibirna
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 ------- Additional Comments From tibirna kde org 2007-11-13 19:35 ------- Fabien Thanks a lot for a really great research. This is a good basis to start in case it proves to be necessary. Yes, indeed, I speak of the image scaling algo, not of the on-screen zoom algo. Speaking of which, I should have mentioned it, the on-screen zoom is really really good. It's better than GIMP's default image scaling. To explain: a 3000x2000 photo shown as "fit to screen" (about 25% zoom -- on my screen at least) is about the same (pixel) size _on screen_ as the same photo, resized at 800x600 photo and shown 100% on screen. But the 3000x2000 photo at 25% zoom looks way better (i.e. with almost no visible resizing artifacts) than the 800x600 at 100%. I know this doesn't help much, but perhaps hints to comparing on-screen zooming (i.e. temporary resizing) with actual image scaling (permanent resizing). And yes, time permitting, I will try to look at the kipi code too. Thanks a lot. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Cristian Tibirna
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 ------- Additional Comments From caulier.gilles gmail com 2007-11-16 07:55 ------- I have found a speed way to fix this problem. In CImg library, there is an algorithm to resize image like we want. This one do not dependant of Greystoration algorithm used in Restoration mode. To be clear, CImg is a low level image manipulation library. Greystoration is an algorithm witch use CImg. In my Qt Greycstoration interface, there is already a simpleResize() method witch do not use Greycstoration algorithm. There is a parameter to set the interpolation method: //! Return a resized image. /** \param pdx = Number of columns (new size along the X-axis). \param pdy = Number of rows (new size along the Y-axis). \param pdz = Number of slices (new size along the Z-axis). \param pdv = Number of vector-channels (new size along the V-axis). \param interp = Resizing type : - -1 = no interpolation : raw memory resizing. - 0 = no interpolation : additional space is filled with 0. - 1 = bloc interpolation (nearest point). - 2 = mosaic : image is repeated if necessary. - 3 = linear interpolation. - 4 = grid interpolation. - 5 = bi-cubic interpolation. \note If pd[x,y,z,v]<0, it corresponds to a percentage of the original size (the default value is -100). **/ CImg get_resize(const int pdx=-100, const int pdy=-100, const int pdz=-100, const int pdv=-100, const int interp=1, const int border_condition=-1); I will provide a patch to test this way... Gilles _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Cristian Tibirna
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 ------- Additional Comments From caulier.gilles gmail com 2007-11-16 07:59 ------- #11 ==> Christian, in kipi-plugins : - Batch resize tool use ImageMagick (8 and 16 bits color depth). There is no problem here. - Resize operations in others place use QImage method (8 bits color depth only). No problem here too (HTMLExport, SendImages, etc...) Gilles _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Cristian Tibirna
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 ------- Additional Comments From caulier.gilles gmail com 2007-11-16 08:09 ------- Arnd, I'm too wrong !!! Do you know ??? Perhaps i need aspirin... Forget all that i said before... It's wrong (:=))) Image Editor resize tool use everywhere CImg library ! 1/ If "Restoration" mode is _not_ use, CImg::resize() method is called with a linear interpolation. 2/ If "Restoration" mode is used, Greycstoration algorithm is used. (But here it's not the problem) This is want mean than Digikam::Dimg::smoothScale() is not used in this tool (imlib2 based algorithm), and the bug is on CImg algorithm !!! Sorry for the confusion. I really time to leaves the team... Gilles The resize bug is in CImg _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Cristian Tibirna
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 ------- Additional Comments From caulier.gilles gmail com 2007-11-16 08:14 ------- SVN commit 737358 by cgilles: digiKam from KDE3 branch: Image editor Resize tool in Simple Mode (not Restoration) ==> use CImg::resize() bicubic interpolation, not linear, witch will give normally a better result to resize an image to a smaller size Feedback is welcome. Thanks in advance... CCBUGS: 152192 M +1 -1 greycstorationiface.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=737358 _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Cristian Tibirna
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 ------- Additional Comments From arnd.baecker web de 2007-11-16 08:38 ------- I checked with the original example, and it is still not good at all. Does it work for you Gilles? Important: also the "Restoration mode" produces the same type of horrible output!? Independent of this, I think that Fabien's investigation, c#6 to c#10 above, might lead to even better results (in particular to allow for using a different algorithm for down-scaling vs. up-scaling). Maybe there is a possibility to make use of any of the existing codes? _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Cristian Tibirna
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 ------- Additional Comments From caulier.gilles gmail com 2007-11-16 08:46 ------- > Important: also the "Restoration mode" produces the same type of horrible output!? The restoration mode is completely different and not adapted to scaled-down an image, but to scaled-up... for ex. a very small picture to a huge picture. I will add a text in dialog to warm users about this point... Gilles _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
> I will add a text in dialog to warm users about this point... That would be good - users like me don't read manuals (or forget ...), or both ;-) _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Cristian Tibirna
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=152192 ------- Additional Comments From arnd.baecker web de 2007-11-16 09:03 ------- > I will add a text in dialog to warm users about this point... That would be good - users like me don't read manuals (or forget ...), or both ;-) _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |