<div class="gmail_quote">On Fri, Jul 9, 2010 at 3:56 PM, Dmitry Kazakov <span dir="ltr">&lt;<a href="mailto:dimula73@gmail.com">dimula73@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi!<br><br>I was considering implementation of mipmapping and i&#39;ve finally come to a conclusion. We really needn&#39;t mipmapping! :P<br><br>Well, now in details. What the mipmapping technique is and what it isn&#39;t? Mipmapping is used for doing the scaling of textures fast. The main idea of the mipmapping is that we prepare the pyramid first, and then just use the same pyramid for wrapping onto objects of different sizes. <br>

<br>What do we have i Krita? Our &quot;textures&quot; are updated with every stroke, so the pyramid will have to be rebuild after every transaction, that means that we will have to do up to 30% more work. And what are the benefits of the pyramid? There is only one, actually: &quot;fast&quot; zooming. Have you ever seen slow zoom operation in Krita? Just try it! I&#39;ve checked it today: Ctrl-+/Ctrl-- on the image of 5000x5000px is performed in less than a second. I think this is more than enough for most usecases.<br>

<br>There is one more usecase of the pyramid can be considered: working not with originals of the image, but with its scaled-down copies.That is the thing GEGL incorporates. This is really difficult to achieve due to differences in architectures between Gegl and Krita (we will have to rewrite paintop and filter framework for this).<br>

<br>Actually, there is one workaround for this rewriting. We can let our tools work with originals of the layers. But merge of the layer stack will be performed using scaled-down copies. The idea is good, but we will have to decide, what to do with Adjustment Layers and Filter Masks? Not all of them will be able to work with scaled images - so modifying of Filter API is inevitable (we can include it into the plan, btw).<br>
</blockquote></div><br>I think it would be better to decide in a case by case way. For example we have some filter that can run on a scaled-down version like most color adjustments. Since these are very common filters this would give us a big speedup. In other case the filter would fallback to original.<br>
To avoid these fallbacks it might be a good idea to limit adjustment layers and filter masks to the filters that can do the shortcut.<br><br>For the paintops: What would it require to get a paintop to work with mipmapping? Maybe we would just special case for the most common paintops like pixel brush to enable them to paint on a scale-down version. It would be just an approximation, but it might be worth the work if it&#39;s close enough to the real result.<br>