Talk:Image editing techniques and algorithms using Qt
Daliusd - Grey scaleOverall nice listing of algorithms but my recommendation for grey scale algorithm is to use luma formula Y = 0.2126 R + 0.7152 G + 0.0722 B from Luma instead of giving similar weight to each color.
15:55, 10 May 2012 (EEST)
Hamishwillee - Awesome
Great article. I like in particular how you've kept it focussed with clear code samples and good comparative images. This would make it much easier for anyone who wanted to create an image editing app.
Given the aim of this code is "re-use" I might have suggested that you did not make this compromise: "To simplify the code below we are reading pixel by pixel, but reading a full line with the method QImage::scanLine(int i) is more efficient.". That said, if people understand the first code, it should be possible for them to adapt it to reading a while line.
FYI, I subedited to add more links to reference documentation, and added MeeGo category - I know its untested, but there is nothing here that shouldn't work.
09:09, 11 May 2012 (EEST)
Chintandave er - nice article !
Nice article. Thanks for that.Chintan.
Chintandave er 09:25, 11 May 2012 (EEST)
Thanks for you modifications Hamishwillee, it's the first time I write an article in the wiki and I'm not used to the conventions.
I really wanted to keep the code simple because even if this code can be reused, as Daliusd pointed with his comment there are many ways to do the same thing and it can be quite more complex, and I wanted this article could serve as an entry point to image editing so I prefer the code is easy to understand than efficient. For example, I remember the first time I made a game, it was after my first year in university and I knew how to code but I didn't know how a game worked. It was thanks to the documentation I found in the old Siemens Mobile developer website and Forum Nokia - yeah, it was quite some time ago :) - that I understood it, a game loop with 3 steps: read the input from the user, update the game, draw the result on the screen. After that I could write my own games, and I wanted that with the article for people that don't know how image editing works.But anyway, your suggestion gave me an idea and I have written an example on how to modify a method to read a full line from an image.
18:22, 11 May 2012 (EEST)
Hamishwillee - Cool!
You're welcome. Thanks for explaining your reasoning - its certainly a good argument for keeping things simple.
One thing that did occur to me is that if you do this calculation in a UI thread it could make the UI unresponsive. It may be worth putting in a comment on this and linking to topics on how to do the image manipulation in a worker thread (like Multi-Threaded Image Processing using Qt Camera). I believe you can do your processing in a QImage on another thread, but not in a QPixmap. Anyway, just something for you to think about.
Yes, it's possible using QPainter with QImage in a different thread, with QPixmap it's not recommended or you can end up with a blank image if UI thread is updated at the same time -if it's not updated at the same time it should work fine too, but using standard UI controls that's hard to manage-.This weekend I'll try to update the sample app processing the images in a secondary thread and add the advice in the introduction section. I'll also add an animation while the image is being updated.
19:02, 17 May 2012 (EEST)
Hamishwillee - Thanks!
Sounds great, if you have time. If you don't, then given the nature of your article, just treating multithreading as a separate issue (ie explaining the need and linking to instructions) would be sufficient.FYI, Tuesday is deadline for next selection round.
08:25, 25 May 2012 (EEST)