Using the GOQRCodeGenerator transformer I can write the output into a PNG writer. It works very well. However, I wanted to add one of the attributes below the QRCode so each code can be added to the right bin. How do I add this attribute with the raster before it writes to PNG. I've tried TextAdder, rastermosaicker and I have not gotten it to work.
Hello.
What information do you want to add?
I haved created one with geolocalization before.
Thanks.
Danilo
It's an attribute from the feature with feature type oracle non-spatial.Same attribute that goes to the qr code.
Hi @salvaleonrp,
This can be done by creating a separate image of the attribute, moving it just below the QR code, then mosaicking them together.
To create the attribute image, use a TextAdder to create the text from the attribute, then a TextStroker to convert the text to polygons.
Use an ImageRasterizer to create the attribute image, setting the image width to the same as that used in the GOQRCodeGenerator.
Next, use a RasterGeoreferencer to set the upper left X,Y to match the lower left X,Y of the QR code image - if you set the QR image size to 200, the lower left will be at 0,-200.
Finally, send both images to the RasterMosaicker to combine them.
I have attached a simple workspace to illustrate the process: labelqr.fmw
Hi @salvaleonrp,
This can be done by creating a separate image of the attribute, moving it just below the QR code, then mosaicking them together.
To create the attribute image, use a TextAdder to create the text from the attribute, then a TextStroker to convert the text to polygons.
Use an ImageRasterizer to create the attribute image, setting the image width to the same as that used in the GOQRCodeGenerator.
Next, use a RasterGeoreferencer to set the upper left X,Y to match the lower left X,Y of the QR code image - if you set the QR image size to 200, the lower left will be at 0,-200.
Finally, send both images to the RasterMosaicker to combine them.
I have attached a simple workspace to illustrate the process: labelqr.fmw
Powerful Workspace.
Hi @salvaleonrp,
This can be done by creating a separate image of the attribute, moving it just below the QR code, then mosaicking them together.
To create the attribute image, use a TextAdder to create the text from the attribute, then a TextStroker to convert the text to polygons.
Use an ImageRasterizer to create the attribute image, setting the image width to the same as that used in the GOQRCodeGenerator.
Next, use a RasterGeoreferencer to set the upper left X,Y to match the lower left X,Y of the QR code image - if you set the QR image size to 200, the lower left will be at 0,-200.
Finally, send both images to the RasterMosaicker to combine them.
I have attached a simple workspace to illustrate the process: labelqr.fmw
Hi, could you share your workspace?
In the ImageRasterizer you can enable Anti-Aliasing. This will smooth the text rendering for you.
@DaveAtSafe I'm back at this project and the sample workspace does not work anymore. It errors out on the RasterMosaicker,
RasterMosaicker(RasterMosaicFactory): All input rasters must have the same number of selected bands. The raster '1' has '4' selected bands, but the mosaicked raster '0' has '1' selected bands
Any suggestions for me to fix?
What I'm trying to do is add whitespace of about 10 pixels on each side of the QRcode so that the user will not mistakenly scan the QR code above or below it. The user needs space on the QR Codes that are being printed on 8.5 x 11 sheets.
The image below was created using an HTMLReportGenerator/HTML Layouter/HTML writer. If I could add an HTML tag TR after each feature then that would solve the problem but that's not an option for the HTML transformers. My next option is to manipulate the QR Code PNG file itself.
@DaveAtSafe I'm back at this project and the sample workspace does not work anymore. It errors out on the RasterMosaicker,
RasterMosaicker(RasterMosaicFactory): All input rasters must have the same number of selected bands. The raster '1' has '4' selected bands, but the mosaicked raster '0' has '1' selected bands
Any suggestions for me to fix?
What I'm trying to do is add whitespace of about 10 pixels on each side of the QRcode so that the user will not mistakenly scan the QR code above or below it. The user needs space on the QR Codes that are being printed on 8.5 x 11 sheets.
The image below was created using an HTMLReportGenerator/HTML Layouter/HTML writer. If I could add an HTML tag TR after each feature then that would solve the problem but that's not an option for the HTML transformers. My next option is to manipulate the QR Code PNG file itself.
You may need to set the Interpretation Type in the ImageRasterizer to Gray8.