I am working on customizing image like represent.com
I got all things like upload image, change colors of t-shirt and change add text on t-shirt.
But when i am going to save my customized t-shirt design as image it converted to image but it is not same as i have customized. There is black rectangle on t-shirt only if i will add image or add text on t-shirt otherwise if i change color of t-shirt then it is working well.
How should i upload it on php server after convert it to image?
I have used canvg plugin canvg plugin My SVG code :
<svg id="canvas" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<desc>Created with Represent</desc>
<defs>
<pattern x="0" y="0" width="380" height="380" patternUnits="userSpaceOnUse" id="Sibvs5t8i8" viewBox="0 0 380 380">
<image xlink:href="https://d28c8q1a6j07u6.cloudfront.net/assets/templates/heather-357782c6b1665b9d38d1e6b3c8a759a5.png" preserveAspectRatio="none" x="0" y="0" width="380" height="380"></image>
</pattern>
<mask id="Sibvs5t8ig">
<g>
<rect x="-2000" y="-2000" width="4000" height="4000" fill="#444444"></rect>
<rect x="-160" y="-309" width="340" height="610" fill="#ffffff" real_size="10,14"></rect>
</g>
</mask>
</defs>
<g transform="matrix(1,0,0,1,367.5,189.5)" class="canvas_centered">
<g class="canvas_layers" transform="matrix(0.361,0,0,0.361,0,0)">
<g class="canvas_background">
<rect class="canvas_variant_color" width="998" height="998" x="-499" y="-499" fill="#fff2d3"></rect>
<rect fill="url('#Sibvs5t8i8')" class="canvas_variant_heather" width="998" height="998" x="-499" y="-499" style="opacity: 0;"></rect>
<rect x="-160" y="-309" width="340" height="610" class="canvas_border" real_size="10,14"></rect>
<line x1="10" x2="10" y1="-309" y2="301" class="canvas_guide"></line>
</g>
<g mask="url('#Sibvs5t8ig')" class="canvas_objects">
<g transform="matrix(1,0,0,1,-160,-298.2784)" style="display: block;"><image xlink:href="http://localhost/craftedusa_prod/t-shirts/uploads/13.jpg" preserveAspectRatio="none" x="0" y="0" width="340" height="272.3214285714286" style="display: block; opacity: 1;"></image></g>
</g>
<g class="canvas_mockups">
<g class="canvas_styles">
<g class="canvas_style">
<g data-side="front" style="opacity: 1;">
<image xlink:href="http://localhost/craftedusa_prod//images/custom_product/shortsleevetee_male_front.png" preserveAspectRatio="none" x="-500" y="-500" width="1000" height="1000" style="display: block;" class="is-style"></image>
</g>
<g data-side="back" style="opacity: 0;">
<image xlink:href="http://localhost/craftedusa_prod//images/custom_product/unisex-shortsleevetee-back.png" preserveAspectRatio="none" x="-500" y="-500" width="1000" height="1000" style="display: none;" class="is-style"></image>
</g>
</g>
</g></g>
</g>
</g>
<g class="canvas_tmp"></g>
</svg>
My custom Design:
Converted image from SVG: