(self.editor is IINKEditor that handles all the drawing)
I want to get image in the exact dimensions as it is on screen. So that if I put the resulting image exactly over my view, it will look exactly the same. There is no scrolling or scaling involved, self.editor.viewSize is exactly the same as in real view.
1) But the exported image I get has twice the width and height of viewSize, AND consist only of upper left quarter of the real view. So it is like quarter of the view made 4 times larger in both dimensions. There is clearly some scaling or transformations involved, but I don't know where.
2) PNG always has transparent background, even though I set drawer.backgroundColor. If I export to JPEG, it always has white background, even though I set drawer.backgroundColor to something else.
Best Answer
G
Gwenaelle @MyScript
said
over 2 years ago
Hello,
Thank you for your update.
The iink editor works on a model with physical coordinates in mm, and performs back and forth transforms from view to physical coordinates.
This is where both the device and image resolutions come into play.
We have not reproduced your issue.
So, could you please, isolate the code where you perform your export and test within one of the sample (Demo or GetStarted) and then share it with us?
Sharing with us an iink sample with the correspond JIIX export, both image exports (with default and customised image export tuning) , as well as the captured screen would also be helpful.
... then the resulting image captures almost exactly the whole correct area of view. But both dimensions of resulting image are 4.54 times bigger then those of self.editor.viewSize . That is by the way over 5000px width, which seems to violate export.image-max-size. Even if I specifically set it to 4096, as I show above.
To me, the biggest problems are the image and viewport dimensions. I could live with multiplying sizes by 2.27 and then reducing image size by 4.45, but I have no idea where these constants came from and if they can be relied upon. Violation of image-max-size does not bother me much, but it looks clearly like a bug to me.
G
Gwenaelle @MyScript
said
over 2 years ago
Thank your for your update.
You should probably tune the image resolution as well, with the "export.export.image-resolution" configuration parameter, as by default the resolution of the exported image is 300 dpi.
So imagine your image resolution is 200 dpi, your code would probably be something like:
I tried the resolution just now, it does not make any difference. Exported image size is always the same, even with resolution 10. BTW I probably don't understand what resolution is that configuration item about. I mean, resolution makes sense when converting between real-world units and pixels. But if I set viewport in pixels and image-max-size in pixels, how could it be influenced by resolution?
G
Gwenaelle @MyScript
said
over 2 years ago
Answer
Hello,
Thank you for your update.
The iink editor works on a model with physical coordinates in mm, and performs back and forth transforms from view to physical coordinates.
This is where both the device and image resolutions come into play.
We have not reproduced your issue.
So, could you please, isolate the code where you perform your export and test within one of the sample (Demo or GetStarted) and then share it with us?
Sharing with us an iink sample with the correspond JIIX export, both image exports (with default and customised image export tuning) , as well as the captured screen would also be helpful.
Kozarek
I have some problems with exporting image from IINKEditor (using ImageDrawer from reference implementation). My code looks like this:
(self.editor is IINKEditor that handles all the drawing)
I want to get image in the exact dimensions as it is on screen. So that if I put the resulting image exactly over my view, it will look exactly the same. There is no scrolling or scaling involved, self.editor.viewSize is exactly the same as in real view.
2) PNG always has transparent background, even though I set drawer.backgroundColor. If I export to JPEG, it always has white background, even though I set drawer.backgroundColor to something else.
Hello,
Thank you for your update.
The iink editor works on a model with physical coordinates in mm, and performs back and forth transforms from view to physical coordinates.
This is where both the device and image resolutions come into play.
We have not reproduced your issue.
So, could you please, isolate the code where you perform your export and test within one of the sample (Demo or GetStarted) and then share it with us?
Sharing with us an iink sample with the correspond JIIX export, both image exports (with default and customised image export tuning) , as well as the captured screen would also be helpful.
Regards,
Gwenaëlle
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstGwenaelle @MyScript
Dear Kozarek,
Thank you for your question.
Could you please, also share the content part type that you are using?
Regards,
Gwenaëlle
Kozarek
It's "Drawing" type. No converted text, just pencil lines.
Kozarek
I have done some more tests. If I specify configuration like this:
... then the resulting image captures almost exactly the whole correct area of view. But both dimensions of resulting image are 4.54 times bigger then those of self.editor.viewSize . That is by the way over 5000px width, which seems to violate export.image-max-size. Even if I specifically set it to 4096, as I show above.
To me, the biggest problems are the image and viewport dimensions. I could live with multiplying sizes by 2.27 and then reducing image size by 4.45, but I have no idea where these constants came from and if they can be relied upon. Violation of image-max-size does not bother me much, but it looks clearly like a bug to me.
Gwenaelle @MyScript
Thank your for your update.
You should probably tune the image resolution as well, with the "export.export.image-resolution" configuration parameter, as
by default the resolution of the exported image is 300 dpi.
So imagine your image resolution is 200 dpi, your code would probably be something like:
Best regards,
Gwenaëlle
Kozarek
I tried the resolution just now, it does not make any difference. Exported image size is always the same, even with resolution 10. BTW I probably don't understand what resolution is that configuration item about. I mean, resolution makes sense when converting between real-world units and pixels. But if I set viewport in pixels and image-max-size in pixels, how could it be influenced by resolution?
Gwenaelle @MyScript
Hello,
Thank you for your update.
The iink editor works on a model with physical coordinates in mm, and performs back and forth transforms from view to physical coordinates.
This is where both the device and image resolutions come into play.
We have not reproduced your issue.
So, could you please, isolate the code where you perform your export and test within one of the sample (Demo or GetStarted) and then share it with us?
Sharing with us an iink sample with the correspond JIIX export, both image exports (with default and customised image export tuning) , as well as the captured screen would also be helpful.
Regards,
Gwenaëlle