Comment 22 for bug 169985

Revision history for this message
Jimmy Volatile (spam-useful) wrote : Re: [Bug 169985] Re: Slicing pluging (for web and whatnot)

Sorry. I know you were asking Matt but here's my reply to why slices is
often needed:

A typical web or application design consists of both foreground objects and
background objects. The foreground objects are typically icons, buttons and
similar where the area of the object = the area of the final .png-file.

The backgrounds are often exported in much larger areas which do not
correspond with the objects or groups that they are made up of. Slices allow
one to overcome this problem as one just define whatever rectangular areas
are required by the HTML-code or application and export those. Another
benefit is that the design can change quite independently of the slices. One
does not have to reapply the export-names to new design objects copied in
from other files. Conversely, with a proper slices system, it's also
possible to copy slice-sets between files thus allowing quick production of
new websites based on the same HTML-structure.

Now, the current problem with slices in Inkscape is that they are not
visible and there is only a DIY "hackaround" solution for slicing designs by
using a somewhat non-obvious workflow involving either tab-selecting
invisible slices and then exporting or switching a separate slices layer on,
selecting the slice and then switch it off again while retaining the
selection before finally exporting.

Making the final step towards some kind of visible, slectable and exportable
slices would make Inkscape better than most other well known slicing tools
out there since it supports both exporting slices *and* any named, selected
objects. This would be far better than Adobe Fireworks which only supports
one layer of slices but has *no* options for exporting single objects like
Inkscape does.

With regs,

Jimmy Volatile

On Fri, Sep 18, 2009 at 10:49 PM, bbyak <email address hidden> wrote:

> Matt: how is it better than the "batch export selected objects" option
> in Export dialog? If it's better in some respects, maybe it's preferable
> to improve that option to match, instead of adding an extension?
>
> --
> Slicing pluging (for web and whatnot)
> https://bugs.launchpad.net/bugs/169985
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Inkscape: A Vector Drawing Tool: Confirmed
>
> Bug description:
> Attached is a plugin for slicing images.
>
> Here's the process I've used for slicing web layout with Inkscape. Create
> your webpage layout (set page units to "px", width/height appropriately and
> snap to 1 pixel intervals. This should allow pixel perfect alignment). Then
> create a new layer, naming it slices. Draw rectangles over the areas you
> want to slice (set x,y,width,height to whole pixel values). Name these
> rectangles using the Object Properties found in the right click contextual
> menu (the saved images name will be based on that value, so name them
> something like "header" instead of the default/non-useful "rect4312").
>
> What the plugin then does is iterate over all of the rectangle definitions
> found in the slice layer and set the opacity of the slice rectangle to 0.
> (That allows you to make slightly transparent slices, which are easier to
> deal with than invisible ones) It then creates pngs for every slice. After
> completing the slicing, it then sets all the slice rectangles to red at 25%
> opacity. To continue working on your design without having to deal with the
> slices being selected, just "lock" the slice layer and your clicks should
> fall through. You can also click the "eye" on the slice layer to not view
> it.
>