PHP code example of tei187 / qr-image2svg

1. Go to this page and download the library: Download tei187/qr-image2svg library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tei187 / qr-image2svg example snippets


    

  
    use tei187\QrImage2Svg\Configuration;

    $config = new Configuration(
      "/path/to/input",  // input path
      "/path/to/output", // output path
      "input.png",       // input file name
      null,              // no pre-assigned steps per axis
      200,               // threshold
      'red',             // red channel for threshold
      false,             // dont use 'magick' prefix in command line
      true               // use 'convert' prefix in command line
    );

    // (...)
  

    // (...)

    use tei187\QrImage2Svg\Processor\GD as GD;
    use tei187\QrImage2Svg\Processor\ImageMagick as ImageMagick;
    use tei187\QrImage2Svg\Processor\Imagick as Imagick;

    // GD-based library processor
    $gd = new GD($config);

    // ImageMagick-based command line prompt processor
    $im = new ImageMagick($config);

    // Imagick-based extension processor
    $i  = new Imagick($config);

    // (...)
  

    // (...)
    
    // GD
    $gd->output();

    // IM
    $im->output();

    // Imagick
    $i->output();