What's an SVG image rendered as PNG? - svg

There's an svg image of Alabama's state flag # http://en.wikipedia.org/wiki/File:Flag_of_Alabama.svg
The caption says "This image rendered as PNG in other sizes." I downloaded the 1,000-pixel size #
http://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Flag_of_Alabama.svg/1000px-Flag_of_Alabama.svg.png but it won't display on my web page. I opened it in Photoshop, copied it into a new window and saved it with a new file name, but it still doesn't display.
So I guess I was wrong when I thought "rendered as a PNG" means an image is a png. It's actually a SVG...with a .png extension?
Anyway, I just wondered what's going on here and what I need to do to download such images as pngs. Or is the only solution to take a screenshot?

The PNG file you linked to (the ".png" link) is not an SVG. It is definitely a PNG.
I don't know why it isn't displaying for you, but it has nothing to do with SVG.

To get the image as .svg just copy the source of the page (of the image) to an editor. Now save it as an .svg image

Related

Embed svg icon as external file link in adobe illustrator

I would like to link icons into svg as external source.
The reason is that I change this images on client side with javascript.
If icons are jpg or png or similar, I can click "Link" checkbox when place external file. But my icons are in svg format. And checxbox is disabled when I would like to place the svg as external link. I need to have icons as svg since I change also color on the client side(beside different icon).
How can I embed svg icon as external file?
I didn't find a way to do this with adobe illustrator. The workaround is to link to some jpg and then open svg file in notepad and replace external jpg link to external svg link. This way it works.

How to detect animated .jpg image after uploading with nodejs?

I am building a small app with nodejs/expressjs. I made an upload wizard for GIF and JPG images... Depend on images' extension I will classify them into Animated Images or Normal Images...
GIF --> Animated Images
JPG --> Normal Images
But I got a problem, images in JPG can be animated. So how can I detect animated JPG images?
Demo animated JPG: http://picforest.net/pic/0237bbca82954e74902a4afba66df221
I think you can find out that information using EXIF information.
For instance, here's the EXIF info of the image that you have provided:
http://regex.info/exif.cgi?imgurl=http%3A%2F%2Fcdn.picforest.net%2Fupload%2F2015%2F17%2F0237bbca82954e74902a4afba66df221.jpg
It says that it's a GIF image.
There's a node module for exif called https://github.com/gomfunkel/node-exif. Perhaps that may help you out
As it was pointed in comments, there is no such thing as animated JPEGs (except this obscure proposal). Unfortunately this not mean that you can rely on image extension. Extension is just part of file name, it suggest file type, but not determines it. For example image you shared has .jpg extension, but in reality it's GIF and every major browser will treat it as one. In order to detect animated image you must inspect it's content. For example in case of GIF images you could check if first 6 bytes of file is GIF89a or GIF87a, but doing so you will know only that image is a GIF, not that image is an animated GIF. If you want to detect only animated GIFs you must check if they have multiple Image Descriptor Blocks, and it's a little bit more complicated.
It's also worth to mention that currently there are 3 supported by browsers image formats which could contain animation:
GIF - it's rather obvious;
APNG - it's supported by Firefox and Safari, other browsers displays these images as ordinary PNGs;
SVG - SMIL animations are supported by all major browsers except IE and Edge, and there are also CSS and ECMAScript animations.
If you want to detect first two types of animation you can use my node.js library - is-animated, it's rather simple to use:
const isAnimated = require('is-animated');
isAnimated(someBuffer); // -> true/false
Unfortunately currently it doesn't support detecting animated SVGs.

PNG images to SVG

I want to make a responsive website. Part of that is to enhance my graphics. I have a few PNG flat icons that I would like to convert to SVG but I have no knowledge about Illustrator or any other SVG editor. I've tried an online service called vector magic, but the results are not what I need.
What is the best way to convert my images to SVG?
You should try Illustrator to vectorize your images (there is a function to do this). There will never be a perfect result, so you'll have to correct imperfections.
Here is a link that explains how to do this. You'll have then to save your image in "save as" and change the ai filename (for illustrator) to svg.

SVG file looks different in webbrowser than in Illustrator

I've been doing some stuff in Illustrator and I have a problem with saving a project in to SVG file that I open in webbrowser, It just looks different.
And it hapens only in SVG, if I save it to PDF or PNG it looks how it should.
What am I doing wrong?
That's how it looks in Ai
That's how it looks in webbrowser
Here's a link to download rar file with .ai and .svg that I have.
Since all browsers render it the same way, it would seem likely that this is a bug in the AI SVG export filter.
To me it looks like you are applying a blend mode ("Overlay" perhaps?) to the white parts on top of the image. That effect ought to be reproducible using SVG filters, but perhaps AI's exporter doesn't support that yet.
If you are using an "odd" blend mode, try changing it, or reproducing the effect another way.
Individual pixel control needed in identical svg conversion is not possible. SVG creates only specific shapes. The Ai app conversion seems to use opacity to provide the color shades. You could probably tweek opacity and add some svg filters to improve the svg.
Print your design in a . pdf file instead of exporting it directly. Then open the printed .pdf back in Illustrator and export the .svg from this one, it shoud do the trick.

Logo image with text on css3 gradient background of web page

In a web page there is a gradient (in body tag) using CSS3. Moving next and adding image (logo with site name) I realized page gradient and image both has different colors. It is because web page has a background generated by CSS3 and image has a fixed color as background and both are different.
What I have tried ?
add image as background of a div and also as a img tag.
applying gradient on div
but no luck.
How it can be managed ? Please guide.
Thanks
Cant you just save the text of your logo as a .png with a transparent background? If you've added the gradient to your body tag it will change when the browser window expands and contracts
you have to save your logo image with transparent background....you open the psd file of the logo and disable the visibility of the background layer and then save it as a png image.

Resources