skinpeel

Change vita's lockscreen foreground and background randomly
git clone https://git.neptards.moe/neptards/skinpeel.git
Log | Files | Refs | README | LICENSE

README.md (5860B)


      1 Skinpeel
      2 ========
      3 
      4 Change vita's lockscreen foreground and background randomly. Based on reverse
      5 engineering the [fruitpeel][] plugin.
      6 
      7 ![screenshot](screenshot.png)
      8 
      9 Changes from the original plugin:
     10 * Only supports firmware 3.60 for now.
     11 * Uses BC1/DXT1 images instead of 8bpp png files. Generally it should have
     12   better quality images with reduced memory usage.
     13 * Random mode: select random bg/fg on every lock.
     14 * Can also change the foreground image.
     15 
     16 Usage
     17 -----
     18 
     19 Use the `convert` tool to convert your images to `.spraw` files.
     20 
     21 Add `skinpeel.suprx` under `*main` in your taihen config. Copy the background
     22 image to `ur0:data/skinpeel/foo/bg.spraw` and the foreground to
     23 `ur0:data/skinpeel/foo/fg.spraw`.
     24 
     25 If you want to randomly use multiple images, create extra directories in
     26 `ur0:data/skinpeel`. For example, if you have `ur0:data/skinpeel/a` and
     27 `ur0:data/skinpeel/b`, on each lock the plugin will randomly choose `a` or `b`
     28 and load the images inside. You can also have multiple image files as long as
     29 they start with `fg` or `bg` and end with `.spraw`. The plugin will choose a
     30 directory first, then an fg/bg image later. So, for example with a directory
     31 structure like this:
     32 
     33 ```
     34 ur0:data/skinpeel
     35  + foo
     36    + bg0.spraw
     37    + bg1.spraw
     38    + fg0.spraw
     39    + fg1.spraw
     40  + bar
     41    + bg.spraw
     42    + fg.spraw
     43 ```
     44 
     45 On each lock the plugin will choose randomly between `foo` and `bar`. If it
     46 chooses `bar`, it will use the `bar/bg.spraw` and `bar/fg.spraw`. However, if it
     47 chooses `foo`, it will randomly select between `foo/bg0.spraw` and
     48 `foo/bg1.spraw` for background (and the same for fg).
     49 
     50 You can override only the foreground or only the background image, but if you
     51 have multiple directories, make sure each has the same set of images (i.e.
     52 either all or none have `bg*.spraw`, and all or none have `fg*.spraw`). Also
     53 avoid directories without `.spraw` files.
     54 
     55 **Note**: to save about 256 KiB of precious ram, make sure to set the lock
     56 screen background (in the original settings app, Theme & Background -> Start
     57 Screen) to an image with an exact size of 1024x512 (the content doesn't matter,
     58 it will be replaced by the plugin anyway). If you did it right, you should have
     59 a file named `ur0:shell/wallpaper/lock.dds` with a size of `256.12 KB` in
     60 VitaShell (262272 bytes, to be precise).
     61 
     62 Image creation details
     63 ----------------------
     64 
     65 The vita has a screen resolution of 960x544, but the status bar at the top of
     66 your screen is opaque, so you only have 960x512 pixels for the actual image
     67 contents. But due to the limitations of the Vita, you need to specify a texture
     68 with size 1024x512, and it will be scaled back to 960x512 by the Vita. If you
     69 use the convert tool it will handle all of this automatically, but if you have
     70 an input image with a different aspect ratio than 15:8, it will crop it.
     71 
     72 If you need more control over the creation of the image, here are the steps you
     73 should take (this assumes you use gimp, but other image editors should work
     74 too):
     75 
     76 1. Select "Rectangle Select Tool" (R), select Fixed Aspect ratio and set aspect
     77    ratio to 15:8.
     78 2. Select the region of the image you want to use.
     79 3. Image -> Crop to selection
     80 4. Image -> Scale Image, and scale it to 1024x512.
     81 
     82 At this point you can export the image to a png and convert it to spraw with
     83 `convert --no-scale`. (`--no-scale` is important, otherwise it will take the
     84 middle 960x512 of your image and scale it again.)
     85 
     86 Alternatively, you can use DDS images directly. Make sure you set compression
     87 format to DXT1 and no mipmap. The skinpeel plugin will be able to load `.dds`
     88 files created this way directly, but it will be a tinly little bit slower.
     89 
     90 Convert tool
     91 ------------
     92 
     93 You need a c++ compiler to compile it. Running `compile_convert.sh` on linux
     94 should produce an executable called `convert`, on other OS you might need to
     95 tweak it. It can load any images that [stb_image][] can load (jpg, png, tga,
     96 bmp, gif, pic, pnm, and maybe psd, hdr).
     97 
     98 It can either convert a bunch of image files in one go (in this case the
     99 output file will be the input file but with the extension replaced with
    100 `.spraw`), or a single file with a custom output name (specified with `-o`).
    101 
    102 ```
    103 Usage: ./convert [options] input_files
    104  -h --help: print help
    105  -v --verbose: verbose
    106  -s --no-scale: do not scale input, it must be already 1024x512
    107  -f --filter=FILTER: specify scale filter (default, box, triangle, cubic-b-spline, catmull-rom, mitchell)
    108  -q --quality=QUALITY: specify DXT1 compress quality (0..9, 9 is the best)
    109  -o --out=FILE: specify output filename
    110 ```
    111 
    112 Compile Vita plugin
    113 -------------------
    114 
    115 Make sure you have [VitaSDK][] installed. Note that I use version
    116 [1033][vitasdk_1033] of the SDK, it might or might not work with newer versions.
    117 
    118 If you have that, make sure the `VITASDK` environment variable is set to the
    119 correct value and execute `./compile.sh`.
    120 
    121 License
    122 -------
    123 
    124 This program is free software. It comes without any warranty, to the extent
    125 permitted by applicable law. You can redistribute it and/or modify it under the
    126 terms of the Do What The Fuck You Want To Public License, Version 2, as
    127 published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
    128 
    129 Original code written by me is licensed under WTFPL 2. The converter executable
    130 incorporates some third party code under permissive licenes:
    131 
    132 * [`stb_image.h`][stb_image] and `stb_image_resize.h` by stb. Public domain.
    133 * [`icbc.h`][icbc] DXT1 encoder. MIT License.
    134 
    135 The Vita plugin includes [xoshiro128++][] random number generator (public
    136 domain).
    137 
    138 [fruitpeel]: https://forum.devchroma.nl/index.php/topic,338.0.html
    139 [stb_image]: https://github.com/nothings/stb/blob/master/stb_image.h
    140 [vitasdk]: https://github.com/vitasdk
    141 [vitasdk_1033]: https://github.com/vitasdk/autobuilds/releases?q=master-linux-v1033
    142 [icbc]: https://github.com/castano/icbc
    143 [xoshiro128++]: https://prng.di.unimi.it/