Search found 12 matches

by dasprid
2018-07-18T11:46:15-07:00
Forum: IMagick
Topic: Paths and rectangles off by one pixel.
Replies: 14
Views: 13489

Re: Paths and rectangles off by one pixel.

The path doesn't have to be a rectangle though, so that wouldn't really help.
by dasprid
2018-07-17T17:21:51-07:00
Forum: IMagick
Topic: Paths and rectangles off by one pixel.
Replies: 14
Views: 13489

Re: Paths and rectangles off by one pixel.

I'm meanwhile looking for a solution which works with the current way ImageMagick handles paths, but don't seem to be able to find one. The problem I'm trying to solve: I have an SVG path definition I'm trying to hand over to ImageMagick to draw the same path. This generally works the path points ar...
by dasprid
2018-06-15T01:52:24-07:00
Forum: IMagick
Topic: Paths and rectangles off by one pixel.
Replies: 14
Views: 13489

Re: Paths and rectangles off by one pixel.

Since there were no more replies on this, I'm going to breach the subject again. Is this considered wanted behaviour to not conform with the SVG standard or is it a bug?
by dasprid
2018-05-23T16:18:32-07:00
Forum: IMagick
Topic: Paths and rectangles off by one pixel.
Replies: 14
Views: 13489

Re: Paths and rectangles off by one pixel.

To make things simpler, here is the CLI code for a 3x3 image white a dot in the center: convert -size 3x3 xc:skyblue -stroke None -fill black -draw "path 'M 1,1 L 2,1 2,2 1,2 Z'" test.png And here is the exact same path in an SVG: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg xmlns:dc=...
by dasprid
2018-05-23T10:11:11-07:00
Forum: IMagick
Topic: Paths and rectangles off by one pixel.
Replies: 14
Views: 13489

Re: Paths and rectangles off by one pixel.

snibgo wrote:
2018-05-22T13:29:56-07:00
Your code includes "pathClose", which I suppose is equivalent to SVG "z". So I would expect these pixels to be drawn: 5,4 5,5 4,5 and finally 4,4. Is that what you get?
That's what I get, yes. But according to the SVG standard, I should get only the 4,4 pixel drawn.
by dasprid
2018-05-23T10:09:07-07:00
Forum: IMagick
Topic: Paths and rectangles off by one pixel.
Replies: 14
Views: 13489

Re: Paths and rectangles off by one pixel.

snibgo wrote:
2018-05-22T13:29:56-07:00
Yes, the 4,7,4,7 rectangle is blank, because of the SVG convention.
So this means that it is impossible to make a one by one pixel rectangle? since 4,7,4,7 results in nothing, but 4,7,5,8 results in a two by two pixel rectangle?
by dasprid
2018-05-23T10:07:46-07:00
Forum: IMagick
Topic: Paths and rectangles off by one pixel.
Replies: 14
Views: 13489

Re: Paths and rectangles off by one pixel.

Okay, here is some example code for that in SVG: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" id="svg8" version="1.1" viewBox="0 0 10 10" height="10" width="10"> <rect...
by dasprid
2018-05-22T10:42:00-07:00
Forum: IMagick
Topic: Paths and rectangles off by one pixel.
Replies: 14
Views: 13489

Paths and rectangles off by one pixel.

So, in advance, already found this old topic, but didn't want to necro it: http://www.imagemagick.org/discourse-server/viewtopic.php?t=14379 I have the exact same problem with both paths and rectangles. Here is the sample code that I used to trace this back: <?php $image = new Imagick(); $image->new...
by dasprid
2014-07-12T15:21:35-07:00
Forum: Users
Topic: Outline when converting PNG to PDF
Replies: 8
Views: 3279

Re: Outline when converting PNG to PDF

fmw42 wrote:Does your PDF show any transparency against a non-white background? All my attempts are giving a solid white image with perfectly opaque alpha channel (fully opaque and no transparency).
Yep, works perfectly fine.
by dasprid
2014-07-12T15:09:26-07:00
Forum: Users
Topic: Outline when converting PNG to PDF
Replies: 8
Views: 3279

Re: Outline when converting PNG to PDF

Nevermind, I solved it myself. It is kinda tricky because every alpha channel mode has a constant but the "background" one, so I had to figure out the correct integer for that. Just for reference, if anyone else is looking this up: $image = new Imagick('image.png'); $image->setImageFormat('pdf'); $i...
by dasprid
2014-07-12T13:20:29-07:00
Forum: Users
Topic: Outline when converting PNG to PDF
Replies: 8
Views: 3279

Re: Outline when converting PNG to PDF

You can change the background, from transparent black, to transparent white: convert test.png -background White -alpha background out.pdf That indeed did the trick, thanks a lot. Now I'm wondering, do you happen to know how the same would look with the Imagick PHP library? http://php.net/imagick
by dasprid
2014-07-12T11:36:48-07:00
Forum: Users
Topic: Outline when converting PNG to PDF
Replies: 8
Views: 3279

Outline when converting PNG to PDF

Hi, I've stumbled on a problem which took me more than an hour already to investigate. When you take a look at the following image: http://stuff.dasprids.de/images/test.png You'll see that it's a white object on a transparent background. Now when I try to convert it to a PDF with ImageMagick: conver...