Peke ki ngā ihirangi

Image2Pixel

Whakauru

id tauira image2pixel
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/image2pixel?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Tae atu ki te $ 0.153 mō ia whakahaerenga ka utua mō te whakamahinga tūturu, ka whakahokia te toenga Whakahaerehia ki tēnei whārangi

Tikina he kī API
Utility Whakatika Atahanga #post-processing#pixel-art

Ka huri i ngā atahanga hei toi ira mā, me ngā here papatae, te kite tauine me te papamuri pūataata hei kōwhiringa

Utility · Atahanga

Kei konei tō hua tuatahi

Hangaia he tono ki raro nei, ka whakahaere mā tō kī API. Ka tāruatia ngā putanga ki tō mātou rokiroki, ka puritia mō ake tonu atu, mō rānei 7 rā mō te kore utu.

Hangaia he tono

Ka hangaia ngā mana whakahaere mai i te aronuinga o te tauira. Ka whakahoungia te waehere me te utu ina whakarerekē koe.

•e hiahiatia ana image_url
Whakataka he kōnae,

URL atahanga pūtake mō te huri hei pixel art kua whakapai ake.

Arā atu detect_method · downscale_method · background_mode · max_colors · scale · alpha_threshold · dominant_color_threshold · background_tolerance · auto_color_detect · trim_borders · transparent_background · cleanup_morph · cleanup_jaggy · snap_grid · fixed_palette
detect_method taunoa auto

Tikanga e whakamahia ana hei kite i te tauine.

downscale_method taunoa dominant

Tikanga e whakamahia ana hei whakaiti tauine hei pixel art.

background_mode taunoa corners

Ngā wāhi tīmatanga mō te whakakī waipuke i te wā e tango ana i te papamuri.

taunoa 32

Te mōrahi o ngā tae o te papatae putanga; mā None e tuku ngā tae kia kore he here.

Tauine pika hei whakaū; mā None e whakahohe te kitenga aunoa.

taunoa 128

Paepae mō te whakarua i te alpha, mai i te 0 ki te 255.

taunoa 0.05

Paepae mō ngā tae rangatira, mai i te 0.0 ki te 1.0.

taunoa 0

Whakaaetanga mō te papamuri, mai i te 0 ki te 255.

Papatae kua tautuhia kētia, he kōwhiringa, mā ngā aho hex, pērā i ['#000000', '#ffffff'].

POST /run/image2pixel?wait=20 utu → $ 0.153
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/image2pixel?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Whakahaerehia tēnei tono

Ka noho tō kī ki tēnei pūtirotiro: ka tukuna ki te Doitong API anake, ā, ka tiakina ki te localStorage anake ina tohua e koe te Mahara. Tikina he kī API

Mō Image2Pixel

Ka huri i tētahi atahanga tāuru hei toi ira, ka whakahoki i te atahanga kua tukatukahia me tētahi putanga kua whakatauinehia hei kōnae PNG. Ka taea te whakawhāiti i te papatae mā `max_colors` (1 ki te 256), te tuku `fixed_palette` o ngā tae hex, te whakahau rānei i te `scale` mai i te 1 ki te 64. He maha ngā tikanga whakaiti-tauine, ngā kōwhiringa horoi me ngā aratau tango papamuri. Ka pūrongo hoki te urupare i te maha o ngā tae, te papatae me te tauine ira kua kitea.

Ngā tawhā

Tukuna te ingoa tōmua, te ingoa taketake rānei, kaua e rua. Ngā ingoa tōmua

IngoaMomo TaunoaE whakaaetia ana Whakamārama
image_urle hiahiatia ana image
Momourl · image
URL atahanga pūtake mō te huri hei pixel art kua whakapai ake.
max_colorskōwhiringa
Momointeger | null
Taunoa32
1 – 256
Te mōrahi o ngā tae o te papatae putanga; mā None e tuku ngā tae kia kore he here.
auto_color_detectkōwhiringa
Momoboolean
Taunoafalse
Whakahohe ana i te kōwhiringa aunoa o te tatau tae tino pai.
fixed_palettekōwhiringa
Momostring[]
Papatae kua tautuhia kētia, he kōwhiringa, mā ngā aho hex, pērā i ['#000000', '#ffffff'].
detect_methodkōwhiringa
Momoenum
Taunoaauto
autorunsedge
Tikanga e whakamahia ana hei kite i te tauine.
scalekōwhiringa
Momointeger | null
1 – 64
Tauine pika hei whakaū; mā None e whakahohe te kitenga aunoa.
downscale_methodkōwhiringa
Momoenum
Taunoadominant
dominantmedianmodemeancontent-adaptive
Tikanga e whakamahia ana hei whakaiti tauine hei pixel art.
trim_borderskōwhiringa
Momoboolean
Taunoafalse
Ka whakahaere i te kutikuti o ngā taitapa atahanga.
transparent_backgroundkōwhiringa
Momoboolean
Taunoafalse
Te tango papamuri mā te pūataata: ka oti te whakatikatika atahanga, ka pūataata ngā rohe tae hono e pā ana ki te tapa o te atahanga.
cleanup_morphkōwhiringa
Momoboolean
Taunoafalse
Te tango haruru mā ngā mahi āhua.
cleanup_jaggykōwhiringa
Momoboolean
Taunoafalse
Te horoi tapa taratara mā te tango pika hauroki motuhake.
snap_gridkōwhiringa
Momoboolean
Taunoatrue
Ka whakahāngai i te putanga ki te mātiti pika.
alpha_thresholdkōwhiringa
Momointeger
Taunoa128
0 – 255
Paepae mō te whakarua i te alpha, mai i te 0 ki te 255.
dominant_color_thresholdkōwhiringa
Momonumber
Taunoa0.05
0 – 1
Paepae mō ngā tae rangatira, mai i te 0.0 ki te 1.0.
background_tolerancekōwhiringa
Momointeger
Taunoa0
0 – 255
Whakaaetanga mō te papamuri, mai i te 0 ki te 255.
background_modekōwhiringa
Momoenum
Taunoacorners
edgescornersmidpoints
Ngā wāhi tīmatanga mō te whakakī waipuke i te wā e tango ana i te papamuri.
e hiahiatia ana Ingoa tōmua, e whakaaetia ana hoki

Mō ngā tawhā kōnae, whakamahia he URL tūmatanui https://, he URI data: tae atu ki te 10 MB, he file_url rānei o tētahi tukuake. Ngā kōnae

Putanga

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "image2pixel",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 153,
    "usd": "0.153",
    "charged": 153,
    "refunded": 0
  },
  "input": {
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  },
  "output": {
    "pixel_scale": 21,
    "palette": [
      "string"
    ],
    "num_colors": 10,
    "images": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200,
        "width": 1024,
        "height": 768
      }
    ]
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Ō kōnae, māu e whiriwhiriKo ia url o outputs[] he tārua kei tō mātou rokiroki: ka puritia mō ake tonu atu (ka utua ia GB-marama) mō rānei 7 rā mō te kore utu, e ai ki ngā tautuhinga o tō pūkete, ki te ?storage= rānei.
He ōrite te hanga ki ia tauiratype, url, content_type, width, height me duration, mō ngā pikitia, ataata me te oro. Ko output te ahanoa hua ake o te tauira.
Ngā āpure o te putanga
pixel_scale
integerTauine pika i kitea i te tāuru.
palette
array of stringPapatae tae mai i te pāpāho kua tukatukahia.
num_colors
integerTatau tae mō te pāpāho kua tukatukahia.
images
array of object {url, content_type, file_name, file_size, width, height}Pixel art kua tukatukahia me ngā atahanga kua whakarahiat ia, he PNG katoa.

Mō ngā āpiha AI: kei te wātea tēnei whārangi hei Markdown ki https://doitong.com/mi/developers/models/image2pixel.md. Ngā tauira me ngā aratohu katoa: https://doitong.com/developers/llms.txt