うまく表示されないとき
- 確かめる
- 直す
SVGを変換したのに、文字の字体が違う、図が欠ける、真っ白になる。SVGをPNGに変換する の変換結果が、元のSVGと違って見えるときの、原因と対処をまとめます。
まず確認すること
- SVGが、外部の画像やフォントを読み込んでいないか
- SVGのファイル自体が、壊れていないか
- 「プレビュー」で、どう見えているか
手順(直す)
- SVGが、外部の画像やフォントを読み込んでいないか、確かめます。
- できれば、文字を図形(アウトライン)に変換したSVGを使います。
- もう一度、「SVGファイルを1つ選ぶ」から変換します。
よくある症状と原因
- 文字の字体が変わる:SVGが、端末にないフォントを使っている。
- 画像が表示されない:SVGが、外部の画像ファイルを参照している。
- 真っ白になる:背景が白で、図が白い。または、図形が、描画範囲の外にある。
- 一部が欠ける:SVGの描画範囲(サイズ)の設定が、図より小さい。
- 変換できない:SVGの書き方に誤りがある。
文字を図形に変換する
デザインソフトで、SVGを書き出すときに、「テキストをアウトライン化」「文字を図形に変換」のような設定を選ぶと、フォントに依存しなくなります。
外部の画像を埋め込む
SVGから別の画像ファイルを参照している場合は、画像をSVGの中に埋め込んで書き出す設定にします。
描画範囲の確認
SVGの中の、サイズの指定(幅、高さ、表示範囲)が、図全体を含んでいるか確認します。
別の方法で確認する
- ブラウザで、SVGを直接開いて、表示を確認する
- 他のソフトで開いて、同じように崩れるか見る
- 崩れるなら、SVG自体に問題がある
向いている対処
SVGをデザインソフトで開いて、保存し直すと、直る場合があります。
例
手作りのSVGが、PNGにしたら、文字だけ違うフォントになった。デザインソフトで、文字をアウトライン化して書き出し直したところ、見た目が一致した。
つまずきやすい点
- サイズが極端に小さい:SVGに、サイズの指定がない。
- 色が変わる:色の指定方法が特殊。
よくある質問
元のSVGは、変換で変わりますか?
いいえ。新しいPNGができるだけです。
まとめ
外部のフォント・画像への依存が、主な原因。文字は図形にし、画像は埋め込んでから変換しましょう。
SVGをPNGに変換するを使う(無料)あわせて使えるツール
- 画像の形式を変換(JPG・PNG・WebP):画像をJPG・PNG・WebPに、まとめて変換します。
- 画像のサイズ(ピクセル)を変える:画像の大きさを、横幅・縦・割合で変えます。
- ファビコン(サイトのアイコン)を作る:1枚の画像から、ファビコン一式を作ります。
同じツールの、ほかの解説
When the Image Does Not Look Right
- Check
- Fix
You converted an SVG but the typeface is different, parts are missing or it is blank white. Here are causes and remedies for when Convert SVG to PNG's output looks different from the original SVG.
What to check first
- Whether the SVG loads external images or fonts
- Whether the SVG file itself is broken
- How it looks in "Preview"
Steps (fixing)
- Check whether the SVG loads external images or fonts.
- If possible, use an SVG with text converted to shapes (outlines).
- Convert again from "Choose one SVG file".
Common symptoms and causes
- The typeface changes: the SVG uses a font not on the device.
- Images don't show: the SVG refers to an external image file.
- Blank white: the background is white and the figure is white, or the shapes lie outside the drawing area.
- Part is missing: the SVG's drawing area (size) setting is smaller than the figure.
- Cannot convert: there is an error in the SVG's syntax.
Converting text to shapes
When exporting an SVG from design software, choosing a setting like "outline text" or "convert text to shapes" removes dependence on fonts.
Embedding external images
If the SVG refers to a separate image file, export with the setting that embeds the image inside the SVG.
Checking the drawing area
Check that the size specification in the SVG (width, height, viewing area) includes the whole figure.
Checking another way
- Open the SVG directly in a browser and check the display
- Open it in other software and see whether it breaks the same way
- If it breaks, the problem is in the SVG itself
A useful approach
Opening the SVG in design software and saving it again may fix it.
Example
A handmade SVG became a PNG with only the text in a different font. After outlining the text in design software and exporting again, the appearance matched.
Common stumbling blocks
- The size is extremely small: the SVG has no size specification.
- Colours change: an unusual way of specifying colour.
Frequently asked questions
Does conversion change the original SVG?
No. A new PNG is merely made.
Summary
Dependence on external fonts and images is the main cause. Convert text to shapes and embed images before converting.
Use "Convert SVG to PNG" (free)Tools that go well with this
- Convert Image Format (JPG, PNG, WebP): Convert images to JPG, PNG or WebP, several at once.
- Resize Images by Pixel Size: Resize images by width, height or percentage.
- Make a Favicon (Site Icon): Make a complete favicon set from one image.