Bacon / BaconQrCode

QR Code Generator for PHP
BSD 2-Clause "Simplified" License
1.83k stars 208 forks source link

Want to add new Eye and QRcode styles - Not an issue looking for optimal suggestions #120

Closed hafizSiddiq7675 closed 1 year ago

hafizSiddiq7675 commented 1 year ago

I am looking to add a new QR Code style which will look like the following

image

Users will only be able to update the inner color of the eye.

Full Description of the new required designs is described in the following screenshot

image

I am looking for an optimal way to achieve this task.

Thanks in advance

DASPRiD commented 1 year ago

The EyeFill renderer style already allows you to set separate internal and external colors.

As for logos, at the moment BaconQrCode does not support that. I remember an older feature request for that, which was abandoned. What you could do at the moment is render the QR code out normally as SVG or PNG, and then update the result by overlaying it with a white square and optionally the logo.

hafizSiddiq7675 commented 1 year ago

@DASPRiD Thanks for your response, what about the styles, i am looking for any suggestions regarding this.

hafizSiddiq7675 commented 1 year ago

The EyeFill renderer style already allows you to set separate internal and external colors.

As for logos, at the moment BaconQrCode does not support that. I remember an older feature request for that, which was abandoned. What you could do at the moment is render the QR code out normally as SVG or PNG, and then update the result by overlaying it with a white square and optionally the logo.

Right now the problem is I am not sure how to render that particular style.

DASPRiD commented 1 year ago

Which style exactly are you referring to?

hafizSiddiq7675 commented 1 year ago
image

@DASPRiD take a look at this image. I am not sure how I can generate the same type of image

DASPRiD commented 1 year ago

So the eyes are pretty default, I assume you are referring to the bits having a small margin around them?

hafizSiddiq7675 commented 1 year ago

yes, I am referring to the bits, having a different style

DASPRiD commented 1 year ago

In that case you have to create a Module renderer implenting the ModuleInterface. You should be able to copy the SquareModule and adjust the path points by a fraction of a pixel.

hafizSiddiq7675 commented 1 year ago

Thanks for the help, can you give me some suggestions? regarding how to achieve this kind of pattern in SVG?

DASPRiD commented 1 year ago

Well, you want the top left corner of a module to be around +0.05 and the bottom right corner to be around -0.05 on X an Y.

hafizSiddiq7675 commented 1 year ago

I am sorry, I am not getting it, could you explain more please?

DASPRiD commented 1 year ago

I don't have the time to write down complete code for you. I'd suggest to take this to StackOverflow.

hafizSiddiq7675 commented 1 year ago

thank you