I just have white background and single-colored objects with different opacity which don't overlay other objects, so the math behind that should be a lot simpler.Īnyway, this "flattening of transparent artwork" is offered by many commercial programs, eg. For my current needs it doesn't have to be an universal solution for all possible cases of overlapping and object shapes with gradients and another properties. I suppose you are right, but still I believe it is possible. Xav wrote:It might be practical to produce something more limited that would suit your needs for this specific file, but a general solution is likely to be extremely hard, if not impossible, to create. It might be practical to produce something more limited that would suit your needs for this specific file, but a general solution is likely to be extremely hard, if not impossible, to create. I don't mean to "rain on your parade", but I think you're underestimating what would be involved in creating a generic extension to do this. Plus you want the splitting done based on colour, not on the original shapes (again, this brings us back to the problem with gradients). So any boolean operations on your elements would need to be done in the Python environment (complex), or by calling a second instance of Inkscape as a command-line tool (probably complex in a different way). Well it should not be so hard, because Inkscape has powerful tools for cutting various vector shapes which I would use.ĪFAIK those tools aren't available within a Python extension, other than by having the extension run another copy of Inkscape as a background process.Įxtensions are essentially external scripts which get passed the XML document, and return a modified XML document. Xav wrote:The tricky bit isn't the opacity, it's the requirement to cut overlapping pieces into separate sections first. But that will result in each object being made up of a path with lots of nodes, not the simple smooth shapes you started with. If not (and if there aren't too many individual colours in the image), you might be able to achieve something by creating a bitmap copy of your image (Edit > Make a bitmap copy, or File > Export PNG image, then import the result into a new image) followed by tracing the bitmap using multiple scans (Path > Trace Bitmap). I presume you need the final shapes to accurately and precisely match the originals. From the perspective of an extension author they would need to take into account the fact that the overlaps could be any arbitrary shapes, and there could be multiple overlaps to consider. The tricky bit isn't the opacity, it's the requirement to cut overlapping pieces into separate sections first. To your question: is it possible with a Python extension? Probably, given a sufficiently capable programmer. Once the layer is locked, you can’t edit or move it until you unlock it using the same process.You probably should have explicitly asked for an automated process in your first post, or said that it was thousands of objects rather than "many", which is a bit ambiguous. Hover over the righthand side of the rectangle layer until the lock icon appears, and click it to lock the layer. In the Layers and Objects panel, click the arrow next to Layer 1 and find the rectangle layer, which should be named rect. To prevent this from happening, open the Layers and Objects panel by going to Object > Layers and Objects or using the shortcut Shift + Control + L on Windows or Shift + Command + L on Mac. Since the background is an object, you may select and move it accidentally while working. You can also use Create a gradient on the background shape if this is the intention. You can then change the shape’s color using the options at the bottom of the workspace or by using the Fill and Stroke panel. Since the rectangle is covering the content on the canvas, you need to send it to the back by going to Object > Lower to Bottom or pressing the End key. Then, click and drag out to create a rectangle over the entire canvas. To do this, select the Create rectangles and squares tool from the toolbar or press R. You can do this by adding a rectangle at the bottom of your design. There is an alternative method to change the background color in Inkscape, but it’s only suitable in certain situations, such as if you want to temporarily change the background color or add a gradient to the background color. You will see the new background color on the canvas.Īlternative Method to Change the Background Color
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |