Zim

allow images to be scaled and offset within viewport for highlighting detail

Bug #941702 reported by Uncle Pedro
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Zim
Confirmed
Wishlist
Unassigned

Bug Description

This is a total wishlist item.

I often include images in my notes (the main reason I switched away from Tomboy). The images are usually charts, diagrams, or sketches for my research. I love the fact that the image properties dialog includes resizing and the context menu allows for opening/editing the images. However, I think it would be great if the image properties had some more advanced features.

In particular, I'd like to separate the image "viewport" size from the image scaling and also from the image XY offset. This would be useful for highlighting detail in a graph or screenshot (without requiring manually creating a separate cropped image). For example, I often have a graph and I want to show first the original graph and then a specific part of the graph. So I'd like to be able to say "make a X by Y viewport, scale the image by 60%, and display the image starting at pixel N,M". I don't really care about the scaling quality, etc., so I'm not looking for any additional image processing capabilities.

Obviously, doing this would require adding some more options to the image dialog, which for simplicity could be hidden under "advanced" or somesuch. As long as I'm dreaming big, it would be easiest if the offset could be set by dragging a thumbnail, and if the document was updated after changing the parameters to provide a "live preview".

I'm interested in potentially hacking on this, but I'm new to the project so I wonder how feasible you think this would be, based on the underlying image code, etc. I also don't know how plugins work, or whether this would this be better (or even possible) as a plugin? Or perhaps it just would not work within Zim's design or philosophy.

Anyway, thanks!

Tags: wishlist
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 941702] [NEW] allow images to be scaled and offset within viewport for highlighting detail

I think this is easy to hack as a plugin when the "inline objects" feature
is ready. Once that is done you should be able to easily subclass the
standard class for images.

However I think I do not understand the use-case very well.

Revision history for this message
Uncle Pedro (peter.a.h.peterson) wrote :

Here is my use case, illustrated by the attached image.

In my work, I am constantly making plots or diagrams -- these are mostly generated by a program like R, or are hand-drawn by me using my tablet's digitizer. Often the easist way to save a copy of a plot is to take a screenshot. I can immediately insert this screenshot into my notebook. This is the top example in the attachment.

But I'm really just interested in the plot part of the screenshot. So what I'd like to be able to do is create a "viewport" the size of the area of interest, and then set the offset into the original image to show the plot, effectively cropping out the parts of the image I don't care about. Now, of course R (and other programs) can output the plot alone to an image format -- but as I am experimenting with different visualizations and data, it adds steps to test a plot, then replot the output to a file, and import it into my notebook. I'd rather be able to just import the screenshot and then display the part I'm interested in. This is shows in the second image.

However, where the use case really shines is that I often want to highlight a particualr part of a larger diagram or plot. This is shown in the third image. Often, I want to use multiple highlights from the same source image (showing different interesting parts of a larger diagram). Rather than having to re-crop the original image each time, the feature I'm proposing would allow you to simply re-use the original source image, showing the parts you are interested in.

Does that make sense? It's not that I couldn't do the cropping, etc. It's just that I use Zim as a stream-of-consciousness lab journal -- and being able to grab a single screenshot and show multiple highlights from a single image file would really speed up the fluidity of the workflow.

If the "inline objects" functionality would make this more easily possible (which makes sense), then great. I'll look forward to working on the code.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 941702] Re: allow images to be scaled and offset within viewport for highlighting detail

On Mon, Feb 27, 2012 at 7:21 PM, Uncle Pedro <email address hidden> wrote:

> Often, I want to use multiple highlights from the
> same source image (showing different interesting parts of a larger
> diagram). Rather than having to re-crop the original image each time,
> the feature I'm proposing would allow you to simply re-use the original
> source image, showing the parts you are interested in.
>

Yes that makes sense.

And yes, you will the code we are workign on for "inline objects". Reason
is that images are now pretty simple embedded pixbufs. With new framework
they will be full blown objects, which allows to subclass and add the
viewport to them. At the moment there is nothing within the code that can
be put in a viewport.

-- Jaap

Revision history for this message
Uncle Pedro (peter.a.h.peterson) wrote :

That makes perfect sense -- when the code is ready, I'll be happy to work on this.

Thanks a lot for a great project!

-- pedro

Changed in zim:
status: New → Confirmed
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.