I had got a requirement to create a QR code with a logo at the center, so first I thought it may require some different library.
For experiment, I just put a logo using Illustrator at the center on the provided QR code and the scanner was able to read it. I used black and white both bg below logo, still it was reading correctly.
So my question is: if I put a logo within the center of any QR code, will it work fine or should I use a library for this matter?
All QR codes with an image or logo in the center take advantage of the fact that the QR code contains redundant information so it can still be decoded despite poor image quality or poor printing. This is part of the error correction.
The QR code standard does not have any explicit facility for making room in the center for an image.
Thus, your approach is perfectly fine. Any other QR code library would do the same: generate the QR code and then add an image in the center.
To ensure that the QR code can still be successfully scanned, it is advisable to use the higher error correction levels if possible (level Q or H instead of M or L).
Yes is is safe to put a logo on any QR code at center. QR Codes only use the 'outsite dots' to process the information.
If you want you can create a QR Code with a logo online, there are a bunch of websites that let you do that quite easly. For example:
qrty let you create a qr code and put your logo inside it!
Related
Turns out I’m working with the Autodesk Forge viewer and Three.js, trying to render 2D text that can be interacted with (specifically select, rotate, and move).
To do this I am working with meshes (using MeshBasicMaterial, Mesh and TextGeometry) but it turns out that the text does not look perfectly sharp, it presents aliasing and I found that according to the API reference, the antialiasing is not applicable to 2d.
Here are some examples of the problem, as you can see, the more I move away from the plane, the worse the text looks (and even up close it doesn't look perfect):
I have tried to make a test representing the text with a Sprite (despite the fact that it would mean having to change the entire implementation already made with meshes of other functionalities) but apart from the fact that I cannot see it, I have seen example images and they do not appear either well: aliasing is visible from a distance and it looks really blurry up close. Here some examples:
Is there a way to correct this problem or is this the most I can get in 2D? I've tried searching for information on this but can't find anything helpful. And what has puzzled me the most has been realizing that antialiasing was not applicable in the case of 2d, like making it clear that nothing can be done to fix it.
I would be very grateful if you could solve my doubts, thank you very much in advance for your help.
An easier alternative, is to just use a higher pixel ratio for the renderer...
window.devicePixelRatio=2;
viewer.resize();
For example, using the custom geometry text, from Joao's demo, you can see the same aliasing issue at DPR=0.5 and DPR=1.0 ...
https://joaomartins-forge.github.io/textgeometry-sample/
But when I set the DPR=2.0, the text looks clean. The trade off is rendering performance, but your 2D drawings may be simple enough that it won't matter. You can use a 'mouse up' camera settle trick, to switch between DPR of 1 and 2, if you want a better UX experience.
There are a few ways to solve this aliasing issue for 2D (and 3D text).
The way I would recommend for your use case, is to use DIV elements (THREE.CSS3DRenderer), instead of text converted into three.js tessellated triangle geometry, as shown in this blog post:
https://forge.autodesk.com/blog/how-do-you-add-labels-forge-viewer
You can find out more information about THREE.CSS3DRenderer here:
https://threejs.org/docs/#examples/en/renderers/CSS3DRenderer
and an Example here: https://threejs.org/examples/#css3d_periodictable
Using CSS3DRenderer instead of CSS2DRenderer, means you will get the correct scaling (and rotation) of the div element as you zoom into your 2D drawing and the mathematics inside the calculation for the matrix transform has less edge-cases.
Once you are using DIV elements for your text, you will notice that the text is sharper and has no aliasing issues. That's because it is not being rasterized by the webGL pipeline, but by the SKIA library used by chrome/firefox/opera/etc for rasterizing text.
There is one final option, that uses signed-distance fields, but it's probably overkill for what you need.
Let me know if you want some example code.
In CSS or SVG, is it possible to warp text so it looks like it is written on a sphere or looked at using a magnifier?
Something similar to this
I have been look over the internet but could not find any guides.
All of the comments telling that it can't be done are wrong. YES IT CAN BE DONE. Well, it's not easy but possible. Let's start from the beginning.
1. Don't even think about writing the code. You need a vector graphics software. I used Corel Draw to this project.
2. You need to create all text, apply all transformation, style each letter, add shadow, background or whatever you need.
This is a simple project I created. It's a fast draft, but you can style the text exactly as on your photo. You can easily make all letters in the middle bigger than the others.
(sorry it's not in English!)
3. Force Corel Draw or any other program to save svg with fonts not curves.
4. I analyzed the code and I see that each letter is saved separetly as a glyph:
<glyph horiz-adv-x="222" unicode="l"><path d="m63.876 0.23623l-2.504 715.49 87.971 0.33072 2.504-715.49-87.971-0.33072z"/></glyph>
Some other letters are saved as text and transformations are applied:
<text class="fil1 fnt0" x="1045" y="1269"><tspan rotate="335">L</tspan></text>
5. FULL CODE looks like this. It's long. I minified it a little bit.
FIDDLE: https://jsfiddle.net/ubw1rdq7/
SOLUTION 2 - MUCH EASIER
It's not fun if you have each letter saved separetly because the file may be huge. You can save your text as a curve and have only one path. This will behave like an image but you can inline the code into your html.
Here is a fiddle:
https://jsfiddle.net/wyfhfjo4/
In both cases all code is over 30kb in size and I made only simple transformations. i hope I gave you some idea how you can achieve desired effect. 99% of the project is to work in vector editing software like Corel Draw and apply all transformation to the text.
For any 3d transformation it's better to transform the text to curves as it will definitely be easier. As an output you will get a path not glyphs.
It is possible to do this using an feDisplacementMap in SVG, but this is currently bugged in current Chrome, so not very useful to you.
I am using aplypy to create an RGB image of the Eagle nebula from three FITS files, representing the red, green and blue components of the image. The FITS files are available here, 673nm being the red, 656nm the green and 502nm the blue.
import aplpy
aplpy.make_rgb_cube(['673nmos.fits','656nmos.fits','502nmos.fits'], 'nmod_cube.fits')
aplpy.make_rgb_image('nmod_cube.fits','nmod.png')
f = aplpy.FITSFigure('../data/nmod_cube_2d.fits')
f.show_rgb('../data/output/nmod.png')
The image should look something like this, but comes out looking like the image below. The blue component is clearly misaligned with the red and green.
make_rgb_cube is supposed to realign the three images in to the same projection based on the WCS information in each FITS header, according to the docs, but it doesn't seem to be working in this case.
Do I need to employ a star matching library to get the alignment accuracy?
There is an error in the WCS coordinates in the header of the Blue FITS file. I have contacted spacetelescope.org to alert them.
Another example from the site, of M17, is created correctly using the aplpy script shown in the question. Blinking through each filter using DS9, as suggested in the comments, confirms the correct alignment.
Use the STScI software TweakReg to align the images and get a good alignment before combining. More information and worked examples can be found on the DrizzlePac website.
TweakReg:
Combining images using astrodrizzle requires that the WCS information in the headers of each input image align to within sub-pixel accuracy. The tweakreg task allows the user to align sets of images to each other and/or to and external astrometric reference frame or image.
It is optimized for use with HST instruments, but can be adapted for other observatories/instruments.
As I know, standard QR code has securing margin.But I found that many tools that create QR codes without securing margin. And if these QR codes put into dark background, they can't be decoded by many decoders, including zxing QR code decoder. But I did found one QR code decoder can decoder them. I am so curious and I tried to figure out how they do that. I get stuck now. So can anybody help me, give me an idea or a hint?I would appreciate that.
here is a QR code without securing margin.
What those programs do exactly is hard to tell unless you ask their authors directly, but what they may probably be doing is locking onto the inner black squares inside the three corners, instead of locking onto the outsides of the outer borders of those corners. While the outside white border is only fully white when the securing margin is present, the inside white border is always white.
There are plenty of scripts out there that can generate a black and white QR code.
I have a script on my website that will generate the QR code.
However, I wanted a script that allows the user to modify the black and white QR code and customize it to a more colorful QR code.
Are there open source scripts that will allow the user to customize their QR code with color?
So that they can select
QR color
Background color
Use color gradient
Gradient style: Radial
2nd QR color for gradient
Rounded Corners
Upload logo
These sites do not offer their scripts for open source
http://www.qrhacker.com/
http://uqr.me/2012/06/qr-code-beautifier/
There is a round-about way to do colour gradients - I had a need recently to do this and it took some figuring out because, as you observed, those that can are closed source and the open source alternatives don't do it.
Generate the gradient as an image. Someone wrote a helpful PHP class to generate the image for you in a variety of directions and styles - one of which is radial (well, ellipse anyway).
Use a library like endroid's qr-code library.
Reload the QR code in GD and set the QR code colour as transparent.
Overlay the QR code onto your gradient image.