SVG > DXF I wanted to edit a small SVG file in AutoCAD and finally make it a PNG, but AutoCAD couldn't read the SVG directly.
I searched and found a lot of conversion sites, but neither DWG nor DXF could be opened in AutoCAD on the first site I tried.
When I regained my mind and converted it on the next site, I was able to open it brilliantly. Convert SVG to DXF Online Free-Convert SVG DXF
After editing with AutoCAD, I wanted to output as PNG, but the PNG image exported with the PNGOUT
command as shown on the next page is not at a very practical level and is too rough to be used for thumbnails and icons. It was.
PNGOUT[PNG export](command) | AutoCAD 2016 | Autodesk Knowledge Network
AutoCAD > PDF As for the print quality, I have no complaints about it, so it was perfect if I output it as printed matter instead of writing it to a file.
There were five preset PDF plotter preferences, but I didn't hesitate to choose the third ʻAutoCAD PDF (High Quality Print) .pc3`. (I haven't tried anything else.)
PDF > PNG I searched for this too and found a lot of sites, so I tried it on the top site and it worked. PDF PNG Converter-Online PDF to PNG
I used Python's PIL to make the background transparent.
#This is the only import
from PIL import Image
#Open image
im = Image.open("hoge.png ")
#Convert to 8bit grayscale mode.
L = im.convert("L")
#Invert the black and white of the L channel,
A = L.point(lambda x: 255 if x < 128 else 0)
#Combine as alpha channel A.
im = Image.merge("LA",(L,A))
#Save the image.
im.save("hoge2.png ")
The above is a memo to edit the SVG file to PNG.
Only Python can convert SVG files to PNG, but I think that a certain environment is required after editing SVG.
This time, due to the SSD failure, the OS was rebuilt, so I had to work at the company or at hand, but thanks to the conversion site, it was very helpful.
Recommended Posts