/ HSTORAGE, クラウドストレージ, アップローダー

クラウドストレージ「HStorage」の「リアルタイム画像処理機能」について

リアルタイム画像処理

プレミアムユーザー・ビジネスユーザーがアップロードしたファイル限定で、 URL を書き換えることで画像に処理を加えることができます。

URL

https://p.hstorage.io

ウォーターマークの追加

例として、ウォーターマークを付与してみます。

処理前

リアルタイム画像処理前

処理後

リアルタイム画像処理

/watermak がウォーターマークを付与するパスで ?text=hstorage-test-watermark がウォーターマークのパスに対するパラメーターです。

最後に &url= に、直リンクの URL を入れてください。

ウォーターマーク以外にも画像のサイズの調整や、部分切り抜き、色々なことができます。

パス 一覧

/crop

指定した幅または高さで画像をトリミングします。画像の比率は維持されます。

パラメーター

  • width int
  • height int
  • quality int (JPEG-only)
  • compression int (PNG-only)
  • type string
  • file string - Only GET method and if the mount flag is present
  • url string - Only GET method and if the enable-url-source flag is present
  • force bool
  • rotate int
  • embed bool
  • norotation bool
  • noprofile bool
  • flip bool
  • flop bool
  • stripmeta bool
  • extend string
  • background string - Example: ?background=250,20,10
  • colorspace string
  • sigma float
  • minampl float
  • gravity string
  • field string - Only POST and multipart/form payloads
  • interlace bool
  • aspectratio string

/smartcrop

libvips に組み込まれたスマートクロップアルゴリズムを使用して、指定した幅または高さで画像をクロップします。

パラメーター

  • width int
  • height int
  • quality int (JPEG-only)
  • compression int (PNG-only)
  • type string
  • file string - Only GET method and if the mount flag is present
  • url string - Only GET method and if the enable-url-source flag is present
  • force bool
  • rotate int
  • embed bool
  • norotation bool
  • noprofile bool
  • flip bool
  • flop bool
  • stripmeta bool
  • extend string
  • background string - Example: ?background=250,20,10
  • colorspace string
  • sigma float
  • minampl float
  • gravity string
  • field string - Only POST and multipart/form payloads
  • interlace bool
  • aspectratio string

/resize

画像のサイズを幅または高さで変更します。画像のアスペクト比は維持されます。

パラメーター

  • width int required
  • height int
  • quality int (JPEG-only)
  • compression int (PNG-only)
  • type string
  • file string - Only GET method and if the mount flag is present
  • url string - Only GET method and if the enable-url-source flag is present
  • embed bool
  • force bool
  • rotate int
  • nocrop bool - Defaults to true
  • norotation bool
  • noprofile bool
  • stripmeta bool
  • flip bool
  • flop bool
  • extend string
  • background string - Example: ?background=250,20,10
  • colorspace string
  • sigma float
  • minampl float
  • field string - Only POST and multipart/form payloads
  • interlace bool
  • aspectratio string

/enlarge

画像を拡大します。

パラメーター

  • width int required
  • height int required
  • quality int (JPEG-only)
  • compression int (PNG-only)
  • type string
  • file string - Only GET method and if the mount flag is present
  • url string - Only GET method and if the enable-url-source flag is present
  • embed bool
  • force bool
  • rotate int
  • nocrop bool - Defaults to false
  • norotation bool
  • noprofile bool
  • stripmeta bool
  • flip bool
  • flop bool
  • extend string
  • background string - Example: ?background=250,20,10
  • colorspace string
  • sigma float
  • minampl float
  • field string - Only POST and multipart/form payloads
  • interlace bool

/extract

Todo

パラメーター

  • top int required
  • left int
  • areawidth int required
  • areaheight int
  • width int
  • height int
  • quality int (JPEG-only)
  • compression int (PNG-only)
  • type string
  • file string - Only GET method and if the mount flag is present
  • url string - Only GET method and if the enable-url-source flag is present
  • embed bool
  • force bool
  • rotate int
  • norotation bool
  • noprofile bool
  • stripmeta bool
  • flip bool
  • flop bool
  • extend string
  • background string - Example: ?background=250,20,10
  • colorspace string
  • sigma float
  • minampl float
  • field string - Only POST and multipart/form payloads
  • interlace bool
  • aspectratio string

/zoom

Todo

パラメーター

  • factor number required
  • width int
  • height int
  • quality int (JPEG-only)
  • compression int (PNG-only)
  • type string
  • file string - Only GET method and if the mount flag is present
  • url string - Only GET method and if the enable-url-source flag is present
  • embed bool
  • force bool
  • rotate int
  • nocrop bool - Defaults to true
  • norotation bool
  • noprofile bool
  • stripmeta bool
  • flip bool
  • flop bool
  • extend string
  • background string - Example: ?background=250,20,10
  • colorspace string
  • sigma float
  • minampl float
  • field string - Only POST and multipart/form payloads
  • interlace bool
  • aspectratio string

/thumbnail

サムネイルを作成します。

パラメーター

  • width int required
  • height int required
  • quality int (JPEG-only)
  • compression int (PNG-only)
  • type string
  • file string - Only GET method and if the mount flag is present
  • url string - Only GET method and if the enable-url-source flag is present
  • embed bool
  • force bool
  • rotate int
  • norotation bool
  • noprofile bool
  • stripmeta bool
  • flip bool
  • flop bool
  • extend string
  • background string - Example: ?background=250,20,10
  • colorspace string
  • sigma float
  • minampl float
  • field string - Only POST and multipart/form payloads
  • interlace bool
  • aspectratio string

/fit

画像をトリミングせずに、幅と高さの範囲内に収まるようにリサイズします。画像の縦横比を維持 幅と高さは画像の最大外接枠を指定します。

パラメーター

  • width int required
  • height int required
  • quality int (JPEG-only)
  • compression int (PNG-only)
  • type string
  • file string - Only GET method and if the mount flag is present
  • url string - Only GET method and if the enable-url-source flag is present
  • embed bool
  • force bool
  • rotate int
  • norotation bool
  • noprofile bool
  • stripmeta bool
  • flip bool
  • flop bool
  • extend string
  • background string - Example: ?background=250,20,10
  • colorspace string
  • sigma float
  • minampl float
  • field string - Only POST and multipart/form payloads
  • interlace bool
  • aspectratio string

/rotate /autororate

EXIF 方向メタデータに基づいて、それ以上の画像変換を行わずに自動的に画像を回転させます。 入力画像と同じサイズとフォーマットの新しい画像を返します。

パラメーター

  • rotate int required
  • width int
  • height int
  • quality int (JPEG-only)
  • compression int (PNG-only)
  • type string
  • file string - Only GET method and if the mount flag is present
  • url string - Only GET method and if the enable-url-source flag is present
  • embed bool
  • force bool
  • norotation bool
  • noprofile bool
  • stripmeta bool
  • flip bool
  • flop bool
  • extend string
  • background string - Example: ?background=250,20,10
  • colorspace string
  • sigma float
  • minampl float
  • field string - Only POST and multipart/form payloads
  • interlace bool
  • aspectratio string

/flip

画像を左右反転させます。

パラメーター

  • width int
  • height int
  • quality int (JPEG-only)
  • compression int (PNG-only)
  • type string
  • file string - Only GET method and if the mount flag is present
  • url string - Only GET method and if the enable-url-source flag is present
  • embed bool
  • force bool
  • norotation bool
  • noprofile bool
  • stripmeta bool
  • flip bool
  • flop bool
  • extend string
  • background string - Example: ?background=250,20,10
  • colorspace string
  • sigma float
  • minampl float
  • field string - Only POST and multipart/form payloads
  • interlace bool
  • aspectratio string

/flop

画像を上下反転させます。

パラメーター

  • width int
  • height int
  • quality int (JPEG-only)
  • compression int (PNG-only)
  • type string
  • file string - Only GET method and if the mount flag is present
  • url string - Only GET method and if the enable-url-source flag is present
  • embed bool
  • force bool
  • norotation bool
  • noprofile bool
  • stripmeta bool
  • flip bool
  • flop bool
  • extend string
  • background string - Example: ?background=250,20,10
  • colorspace string
  • sigma float
  • minampl float
  • field string - Only POST and multipart/form payloads
  • interlace bool
  • aspectratio string

/convert

画像を変換させます。

パラメーター

  • type string required
  • quality int (JPEG-only)
  • compression int (PNG-only)
  • file string - Only GET method and if the mount flag is present
  • url string - Only GET method and if the enable-url-source flag is present
  • embed bool
  • force bool
  • rotate int
  • norotation bool
  • noprofile bool
  • stripmeta bool
  • flip bool
  • flop bool
  • extend string
  • background string - Example: ?background=250,20,10
  • colorspace string
  • sigma float
  • minampl float
  • field string - Only POST and multipart/form payloads
  • interlace bool
  • aspectratio string

/watermark

ウォーターマークを追加します。

パラメーター

  • text string required
  • margin int
  • dpi int
  • textwidth int
  • opacity float
  • noreplicate bool
  • font string
  • color string
  • quality int (JPEG-only)
  • compression int (PNG-only)
  • type string
  • file string - Only GET method and if the mount flag is present
  • url string - Only GET method and if the enable-url-source flag is present
  • embed bool
  • force bool
  • rotate int
  • norotation bool
  • noprofile bool
  • stripmeta bool
  • flip bool
  • flop bool
  • extend string
  • background string - Example: ?background=250,20,10
  • colorspace string
  • sigma float
  • minampl float
  • field string - Only POST and multipart/form payloads
  • interlace bool

/watermarkimage

ウォーターマークとして画像を追加します。

パラメーター

  • image string required - URL to watermark image, example: ?image=https://logo-server.com/logo.jpg
  • top int - Top position of the watermark image
  • left int - Left position of the watermark image
  • opacity float - Opacity value of the watermark image
  • quality int (JPEG-only)
  • compression int (PNG-only)
  • type string
  • file string - Only GET method and if the mount flag is present
  • url string - Only GET method and if the enable-url-source flag is present
  • embed bool
  • force bool
  • rotate int
  • norotation bool
  • noprofile bool
  • stripmeta bool
  • flip bool
  • flop bool
  • extend string
  • background string - Example: ?background=250,20,10
  • colorspace string
  • sigma float
  • minampl float
  • field string - Only POST and multipart/form payloads
  • interlace bool

/blur

画像にブラーを加えます。

パラメーター

  • sigma float required
  • minampl float
  • width int
  • height int
  • quality int (JPEG-only)
  • compression int (PNG-only)
  • type string
  • file string - Only GET method and if the mount flag is present
  • url string - Only GET method and if the enable-url-source flag is present
  • embed bool
  • force bool
  • norotation bool
  • noprofile bool
  • stripmeta bool
  • flip bool
  • flop bool
  • extend string
  • background string - Example: ?background=250,20,10
  • colorspace string
  • field string - Only POST and multipart/form payloads
  • interlace bool
  • aspectratio string

ご要望・お問い合わせ大歓迎です

この記事に関すること以外にも分からない点や、機能についてご要望等お気軽にご連絡ください。

お問い合わせはこちら