Skip to content

Commit

Permalink
Merge pull request #5 from kepstin/develop
Browse files Browse the repository at this point in the history
Update documentation
  • Loading branch information
kepstin authored Oct 27, 2021
2 parents f1c0c8c + c9ab6d3 commit 62926d2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 52 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Stop pixiv from cropping thumbnails to a square. Use higher resolution thumbnails on Retina displays.

Supports the new bookmarks page! No script update needed!
***2021-10-27** The [updated Discovery page](https://www.pixiv.net/info.php?id=7477) is already supported. No userscript update is required.*

Please note: this script will increase data usage on mobile devices.

Expand Down
77 changes: 26 additions & 51 deletions thumbnail_urls.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,40 @@

## Illustration

Original image is at `https://i.pximg.net/img-original/img/YYYY/MM/DD/HH/MM/SS/NNNNNNNN_pN.jpg` (or `.png`)
Original image is at `/img-original/img/YYYY/MM/DD/HH/MM/SS/NNNNNNNN_pN.jpg` (or `.png`)

## Thumbnail

**bold** is unique size for image type. Thumbnails are always JPEG images.
Thumbnails are always lossy resized/recompressed images.

### Preserve aspect ratio
The following variants of thumbnails are available:

Image path: `…/img-master/img/YYYY/MM/DD/HH/MM/SS/NNNNNNNN_pN_master1200.jpg`
* **standard**: Scaled thumbnails that preserve aspect ratio. Image path is `…/img-master/img/YYYY/MM/DD/HH/MM/SS/NNNNNNNN_pN_master1200.jpg`
* **square**: Cropped thumbnails to fit a square. Image path is `…/img-master/img/YYYY/MM/DD/HH/MM/SS/NNNNNNNN_pN_square1200.jpg`. If a custom (uploader-provided) crop is available, it will have the image path `…/custom-thumb/img/YYYY/MM/DD/HH/MM/SS/NNNNNNNN_pN_custom1200.jpg`
* **crop**: An endpoint that always crops images. Usually odd/custom sizes. Image path is the same as **standard**.
* **webp**: The images served from this variant are webp. The image paths are unchanged, and still end in `.jpg`.

Image path prefixes:
* 100x100: `https://i.pximg.net/c/100x100`
* 128x128: `https://i.pximg.net/c/128x128`
* 150x150: `https://i.pximg.net/c/150x150`
* 240x240: `https://i.pximg.net/c/240x240`
* **240x480**: `https://i.pximg.net/c/240x480`
* 260x260: `https://i.pximg.net/c/260x260_80`
* 360x360: `https://i.pximg.net/c/360x360_70`
* 400x250: `https://i.pximg.net/c/400x250_80`
* 540x540: `https://i.pximg.net/c/540x540_70`
* 600x600: `https://i.pximg.net/c/600x600`
* **600x1200**: `https://i.pximg.net/c/600x1200_90`
* **768x1200**: `https://i.pximg.net/c/768x1200_80`
* 1200x1200: `https://i.pximg.net` (no `/c/` path specified, default size?)

### Square crop

Two possibilities for crop.

Either automatic crop (takes top left corner of image): `…/img-master/img/YYYY/MM/DD/HH/MM/SS/NNNNNNNN_pN_square1200.jpg`

Or uploader-set crop: `…/custom-thumb/img/YYYY/MM/DD/HH/MM/SS/NNNNNNNN_pN_custom1200.jpg`

* 100x100: `https://i.pximg.net/c/100x100`
* 128x128: `https://i.pximg.net/c/128x128`
* 150x150: `https://i.pximg.net/c/150x150`
* 240x240: `https://i.pximg.net/c/240x240`
* **250x250**: `https://i.pximg.net/c/250x250_80_a2`
* 260x260: `https://i.pximg.net/c/260x260_80`
* **288x288**: `https://i.pximg.net/c/288x288_80_a2`
* 360x360: `https://i.pximg.net/c/360x360_70`
* 540x540: `https://i.pximg.net/c/540x540_70`
* 600x600: `https://i.pximg.net/c/600x600`
* 1200x1200: `https://i.pximg.net` (no `/c/` path specified, default size?)

### WEBP

These endpoints use the same url pattern as the jpg ones (including the jpg extension) but actually serve WEBP images. Unless otherwise stated, all endpoint support both preserve aspect ratio and square crop.

* 360x360: `https://i.pximg.net/c/360x360_10_webp`
* 540x540: `https://i.pximg.net/c/540x540_10_webp`
* 600x1200: `https://i.pximg.net/c/600x1200_90_webp` (square crop gives 600x600)

### Other shapes

* **1200x???** crop (used on banners): `https://i.pximg.net/c/w1200_q80_a2_g1_u1_cr0:N.NNN:N:N.NNN/img-master/img/YYYY/MM/DD/HH/MM/SS/NNNNNNNN_pN_master1200.jpg`
* 300x200 crop (used on howto page): `https://i.pximg.net/c/300x200_a2/img-master/img/YYYY/MM/DD/HH/MM/SS/NNNNNNNN_pN_master1200.jpg`
* 100x100: `/c/100x100` **standard** **square**
* 128x128: `/c/128x128` **standard** **square**
* 150x150: `/c/150x150` **standard** **square**
* 240x240: `/c/240x240` **standard** **square**
* 240x480: `/c/240x480` **standard**
* 250x250: `/c/250x250_80_a2` **square**
* 260x260: `/c/260x260_80` **standard** **square**
* 288x288: `/c/288x288_80_a2` **square**
* 300x200: `/c/300x200_a2` **crop**
* 360x360: `/c/360x360_70` **standard** **square**, `/c/360x360_10_webp` **standard** **square** **webp**
* 400x250: `/c/400x250_80` **standard**
* 540x540: `/c/540x540_70` **standard** **square**, `c/540x540_10_webp` **standard** **square** **webp**
* 600x600: `/c/600x600` **standard**
* 600x1200: `/c/600x1200_90` **standard**, `/c/600x1200_90_webp` **standard** **webp** (**square** gives 600x600)
* 768x1200: `/c/768x1200_80` **standard**
* 1080x600: `/c/1080x600_10_a2_u1_webp` **crop** **webp**
* 1200x1200: *no prefix* **standard** **square**
* 1200x???: `/c/w1200_q80_a2_g1_u1_cr0:N.NNN:N:N.NNN` **crop**

## Notes

All sizes ending in `_a2` provide only cropped image, no original aspect ratio.
All sizes containing in `_a2` provide only cropped image, no original aspect ratio.
Unknown what `_70`, `_80`, and `_90` mean.

0 comments on commit 62926d2

Please sign in to comment.