Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

SV Image Injector Switch: Difference between revisions

From GameBrew
(Created page with "{{Infobox Switch Homebrews |title=SV Image Injector |image=svimageinjectorswitch.png |description=Edit and Extract Player Profile and Icon Pictures. |author=PizzaTimeJoshua |lastupdated=2023/09/17 |type=Hack Utilities |version=1.1.0 |license=Mixed |download=https://dlhb.gamebrew.org/switchhomebrews/svimageinjectorswitch.7z |website=https://gbatemp.net/threads/trainer-icon-and-profile-injector-w-pkhex-for-pokemon-scarlet-and-violet.639798/ |source=https://github.com/Pizza...")
 
No edit summary
 
Line 13: Line 13:
|donation=
|donation=
}}
}}
{{#seo:
Edit and Extract Player Profile and Icon Pictures. Using PKHeX's Block Data Import and Export tool, it is possible to extract and edit a Player's Profile and Icon images.
|title=Switch Rom Hacks (Hack Utilities) - GameBrew
|title_mode=append
|image=svimageinjectorswitch.png
|image_alt=SV Image Injector
}}
SV Image Injector is a tool for editing and extracting player profile and icon pictures. By utilizing [[PKHeX 3DS|PKHeX]]'s Block Data Import and Export feature, you can extract and modify a player's profile and icon images.


==Requirements==
'''Note:''' The authors are not responsible for any console or game getting banned by Nintendo or Pokemon for using this project, files or code. Injecting images onto a game is a clear sign of a hacked Switch Console. You accept all responsibility for using any of their files.
The Python file uses [https://github.com/K0lb3/texture2ddecoder texture2ddecoder], [https://github.com/K0lb3/etcpak etcpak], and [https://pypi.org/project/Pillow/ Pillow]. You can follow the links and installation instructions. Alternatively, in the [https://github.com/PizzaTimeJoshua/SV-Image-Injector/releases Releases], you can find a compiled executable.


==Usage==
== User guide ==
===Injecting a Custom Image to a Save File===
=== Requirements ===
The process for a custom Profile image and a custom Icon image are similar. Both will be covered here since the process is nearly identical. Be sure to have you both your Profile and Icon image already changed before trying.
The Python file relies on the following libraries: [https://github.com/K0lb3/texture2ddecoder texture2ddecoder], [https://github.com/K0lb3/etcpak etcpak], and [https://pypi.org/project/Pillow/ Pillow]. Please follow the provided links for installation instructions. Alternatively, you can find a compiled executable in the [https://github.com/PizzaTimeJoshua/SV-Image-Injector/releases Releases] section.


====Image Requirements ====
This project also utilizes PKHeX and require access to your game's save file.
The Size Requirements ''may'' vary between users. For reasons I can't figure out, the size may be one of the following:


For '''Profile Images''', its a '''width of 1440 pixels''' and '''height of 832 pixels'''. (This value is the default) For '''Icon Images''', its a '''width of 352 pixels''' and '''height of 352 pixels'''. (This value is the default)
=== Injecting a custom image to a save file ===
'''Image requirements:'''


'''OR'''
The size requirements may vary between users:
* For Profile Images, it's width of 1440 pixels and height of 832 pixels (default), or width of 960 pixels and height of 544 pixels.
* For Icon Images, it's width of 352 pixels and height of 352 pixels (default), or width of 224 pixels and height of 224 pixels.


For '''Profile Images''', its a '''width of 960 pixels''' and '''height of 544 pixels'''. For '''Icon Images''', its a '''width of 224 pixels''' and '''height of 224 pixels'''.
'''Before you start:'''


The width and height have to match the image you want to inject. You ''can'' change the value to the first groupings of sizes to maximize the quality of the image you want to inject. The sizes in the first set of grouping is close to the limit of the file size of what an image can be uploaded so it is ''not'' recommended that you increase the size beyond the ''width of 1440'' and ''height of 832''.
Verify the image width and height by checking your save file on PKHeX. Open PKHeX, import your Save File, go to the SAV tab, and select Block Data. Look for the Block Data that contains the width and height for the type of image you want to inject.


Before ''must'' first verify what the image width and height by checking your save file on PKHeX.
For Profile Image, the Block Keys you need to look for are:


Open PKHeX and import you ''Save File''. Afterward, Select the ''SAV'' tab and select ''Block Data''.
* UInt32 KPictureProfileCurrentWidth
* UInt32 KPictureProfileCurrentHeight


https://dlhb.gamebrew.org/switchhomebrews/svimageinjectorswitch-01.png
For Icon Image, the Block Keys you need to look for are:


Then you need to locate the Block Data that contains the width and height of the type of image you want to inject into your save file.
* UInt32 KPictureIconCurrentWidth
* UInt32 KPictureIconCurrentHeight


For Profile Image these are the Block Key you need to look for. They show the ''width'' and ''height'' respectively:
Take note of the values, or you can change the values between two sizes per Image requirement.


<pre>*UInt32 KPictureProfileCurrentWidth
After you have the width and height, prepare an image that match those values.
*UInt32 KPictureProfileCurrentHeight</pre>


For Icon Image these are the Block Key you need to look for. They show the ''width'' and ''height'' respectively:
'''Using SV Image Injector:'''


<pre>*UInt32 KPictureIconCurrentWidth
* Open the SV-Image-Injector executable or run the Python file.
*UInt32 KPictureIconCurrentHeight</pre>
* If you've changed your width/height value or the values on your save file are different from default, indicate the values to the program through File &gt; Configure.
* Input the appropriate values and save.
* Click on Select File and choose your image file. The Console Messages should confirm the selection and automatically choose the correct option.
* If changing the Icon Image, select Icon Picture instead of the Profile Picture option.
* Click Convert and Save to save a binary file. A message should confirm successful compression.


Below is what you should see. In this case, this is for the Profile Width. The value seen on the side is listed as 1440. If you see a lower value, keep note of it OR change the value right now.
'''Using PKHeX to finish:'''


https://dlhb.gamebrew.org/switchhomebrews/svimageinjectorswitch-02.png
* Open PKHeX and import your Save File.
* Go to the SAV tab and select Block Data.
* Locate the Block Data that contains the Image you want to inject.
** For Profile Picture, it's called Object KPictureProfileCurrent.
** For Icon Picture, it's called Object KPictureIconCurrent.
* Click on Import Current Block and select the binary file you just created to import.


Now that you have your width and height, you need to have an image that matches those two values. With that image ready, we can continue.
'''To confirm if you have imported the image:'''


For this example, I will inject the following image to my Save File as a ''Profile Image'':
* Close the Savedata Block Dump window.
* Select the Trainer Info tab.
* 3 The Images tab should display the injected image.


https://dlhb.gamebrew.org/switchhomebrews/svimageinjectorswitch-03.png
=== Extracting an image from a save file to a PNG ===
'''Easy Way:'''


Now that I have my image ready, I need to open the executable or run the Python file directly. The program should looking something like this:
* Open PKHeX and import your Save File.
* Go to the SAV tab and select Trainer Info.
* Select the Images tab and find your Profile and Icon Pictures.
* Clicking on any image prompts you to save it.


https://dlhb.gamebrew.org/switchhomebrews/svimageinjectorswitch-04.png
'''Harder Way:'''


If you have elected ''not'' to change your width/height value ''AND'' the value on your save file are different from what the default is, you need to indicate what values you have to the program. This can be done by selecting the ''File'' and subsequently ''Configure''. A window separate window should show up.
* Open PKHeX and import your Save File.
* Go to the Block Data tab.
* Locate the Block Data containing the image.
** For Profile Picture, it's Object KPictureProfileCurrent.
** For Icon Picture, it's Object KPictureIconCurrent.
* Export the Current Block and save as a binary file.
* Use SV-Image-Injector with the 'BIN to Image' option selected to uncompress the image file.


https://dlhb.gamebrew.org/switchhomebrews/svimageinjectorswitch-05.png
== Changelog ==
'''v1.1.0 2023/09/17'''


Input the appropriate values and then ''Save'' after ensuring the values are the correct. This should close the window.
* ADDED: Configure Top Menu.
 
* Output Console can now scroll.
Back to the main window, click on ''Select File'' and select your image file. Afterwards, the ''Console Messages'' should confirm you selected an Image file and automatically select the correct option for you. If you have opted to change your ''Icon Image'', then also be sure to select ''Icon Picture'' instead of the ''Profile Picture'' option.
* Configure menu allows you to adjust the Width and Height values.
 
* Adjusted overall code to be easier to look at.
https://dlhb.gamebrew.org/switchhomebrews/svimageinjectorswitch-06.png
 
Now click on ''Convert and Save'' to save a binary file. A message should say <code>Image Successfully Compressed</code> to confirm no error occurred. With the binary file ready, we now need to use PKHeX to finish the rest of the process.
 
Open PKHeX and import you ''Save File''. Afterward, Select the ''SAV'' tab and select ''Block Data''.
 
https://dlhb.gamebrew.org/switchhomebrews/svimageinjectorswitch-07.png
 
Then you need to locate the Block Data that contains the Image you want to Inject. For the Player's Profile Picture, its called:
 
<pre>*Object KPictureProfileCurrent</pre>
 
And for the Player's Icon Picture, its called:
 
<pre>*Object KPictureIconCurrent</pre>
 
You can type it out or scroll through the Block Key to find it.
 
https://dlhb.gamebrew.org/switchhomebrews/svimageinjectorswitch-08.png
 
After you found your corresponding Block Key, click on ''Import Current Block'' and select the binary file you have just obtained to import.
 
To confirm that you've successfully imported the image, close the ''Savedata Block Dump'' window. Then select the ''Trainer Info'' tab.
 
https://dlhb.gamebrew.org/switchhomebrews/svimageinjectorswitch-09.png
 
Then the ''Images'' tabs should show the image you've injected into your save.
 
https://dlhb.gamebrew.org/switchhomebrews/svimageinjectorswitch-10.png
 
If you then have this save file on your switch, it should show the same image for you profile. Below is an image taken from my phone:
 
https://dlhb.gamebrew.org/switchhomebrews/svimageinjectorswitch-11.png
 
Yes I know my screen protector has smudges on them! This is a very old Switch.
 
The similar process also works for the Player's Icon Image.
 
=== Extracting an Image from a Save File to a PNG ===
There are two ways of saving your Profile/Icon Images to your computer from your Scarlet and Violet save file. Use the '''Easy Way''', ''unless'' you have external binary files you want to extract an image from.
 
====Easy Way ====
Open PKHeX and import you ''Save File''. Afterward, Select the ''SAV'' tab and select ''Trainer Info''.
 
https://dlhb.gamebrew.org/switchhomebrews/svimageinjectorswitch-12.png


Then select the ''Images'' tab and you should find your Profile Picture along with your Icon Picture. Clicking on any of the images will prompt you to save that image.
'''v1.0.02023/09/09'''


https://dlhb.gamebrew.org/switchhomebrews/svimageinjectorswitch-13.png
* Initial release.
 
====Harder Way====
The harder and less recommend way of extracting the image is to obtain the binary file directly and then uncompress the image file.
 
Instead of opening the ''Trainer Info'' tab, you instead open the ''Block Data'' tab.
 
https://dlhb.gamebrew.org/switchhomebrews/svimageinjectorswitch-14.png
 
Then you need to locate the Block Data that contains the Image you want to extract. For the Player's Profile Picture, its called:
 
<div class="snippet-clipboard-content notranslate position-relative overflow-auto">
 
<pre>*Object KPictureProfileCurrent</pre>
 
And for the Player's Icon Picture, its called:
 
<pre>*Object KPictureIconCurrent</pre>
 
https://dlhb.gamebrew.org/switchhomebrews/svimageinjectorswitch-15.png
 
Export the Current Block and save as a binary file. Using the SV-Image-Injector, you can follow the steps to inject a custom image, except you will instead have <code>BIN to Image</code> selected before you convert and save.
 
==Changelog==
'''v1.1.0'''
* ADDED: Configure Top Menu
* Output Console can now scroll
* Configure menu allows you to adjust the Width and Height values.
* Adjusted overall code to be easier to look at.
'''v1.0.0'''
* First Release.


== External links ==
== External links ==
* Gbatemp - https://gbatemp.net/threads/trainer-icon-and-profile-injector-w-pkhex-for-pokemon-scarlet-and-violet.639798/
* GitHub - https://github.com/PizzaTimeJoshua/SV-Image-Injector
* Github - https://github.com/PizzaTimeJoshua/SV-Image-Injector
* GBAtemp - https://gbatemp.net/threads/trainer-icon-and-profile-injector-w-pkhex-for-pokemon-scarlet-and-violet.639798/

Latest revision as of 04:07, 8 February 2024

SV Image Injector
Svimageinjectorswitch.png
General
AuthorPizzaTimeJoshua
TypeHack Utilities
Version1.1.0
LicenseMixed
Last Updated2023/09/17
Links
Download
Website
Source

Edit and Extract Player Profile and Icon Pictures. Using PKHeX's Block Data Import and Export tool, it is possible to extract and edit a Player's Profile and Icon images.

Note: The authors are not responsible for any console or game getting banned by Nintendo or Pokemon for using this project, files or code. Injecting images onto a game is a clear sign of a hacked Switch Console. You accept all responsibility for using any of their files.

User guide

Requirements

The Python file relies on the following libraries: texture2ddecoder, etcpak, and Pillow. Please follow the provided links for installation instructions. Alternatively, you can find a compiled executable in the Releases section.

This project also utilizes PKHeX and require access to your game's save file.

Injecting a custom image to a save file

Image requirements:

The size requirements may vary between users:

  • For Profile Images, it's width of 1440 pixels and height of 832 pixels (default), or width of 960 pixels and height of 544 pixels.
  • For Icon Images, it's width of 352 pixels and height of 352 pixels (default), or width of 224 pixels and height of 224 pixels.

Before you start:

Verify the image width and height by checking your save file on PKHeX. Open PKHeX, import your Save File, go to the SAV tab, and select Block Data. Look for the Block Data that contains the width and height for the type of image you want to inject.

For Profile Image, the Block Keys you need to look for are:

  • UInt32 KPictureProfileCurrentWidth
  • UInt32 KPictureProfileCurrentHeight

For Icon Image, the Block Keys you need to look for are:

  • UInt32 KPictureIconCurrentWidth
  • UInt32 KPictureIconCurrentHeight

Take note of the values, or you can change the values between two sizes per Image requirement.

After you have the width and height, prepare an image that match those values.

Using SV Image Injector:

  • Open the SV-Image-Injector executable or run the Python file.
  • If you've changed your width/height value or the values on your save file are different from default, indicate the values to the program through File > Configure.
  • Input the appropriate values and save.
  • Click on Select File and choose your image file. The Console Messages should confirm the selection and automatically choose the correct option.
  • If changing the Icon Image, select Icon Picture instead of the Profile Picture option.
  • Click Convert and Save to save a binary file. A message should confirm successful compression.

Using PKHeX to finish:

  • Open PKHeX and import your Save File.
  • Go to the SAV tab and select Block Data.
  • Locate the Block Data that contains the Image you want to inject.
    • For Profile Picture, it's called Object KPictureProfileCurrent.
    • For Icon Picture, it's called Object KPictureIconCurrent.
  • Click on Import Current Block and select the binary file you just created to import.

To confirm if you have imported the image:

  • Close the Savedata Block Dump window.
  • Select the Trainer Info tab.
  • 3 The Images tab should display the injected image.

Extracting an image from a save file to a PNG

Easy Way:

  • Open PKHeX and import your Save File.
  • Go to the SAV tab and select Trainer Info.
  • Select the Images tab and find your Profile and Icon Pictures.
  • Clicking on any image prompts you to save it.

Harder Way:

  • Open PKHeX and import your Save File.
  • Go to the Block Data tab.
  • Locate the Block Data containing the image.
    • For Profile Picture, it's Object KPictureProfileCurrent.
    • For Icon Picture, it's Object KPictureIconCurrent.
  • Export the Current Block and save as a binary file.
  • Use SV-Image-Injector with the 'BIN to Image' option selected to uncompress the image file.

Changelog

v1.1.0 2023/09/17

  • ADDED: Configure Top Menu.
  • Output Console can now scroll.
  • Configure menu allows you to adjust the Width and Height values.
  • Adjusted overall code to be easier to look at.

v1.0.02023/09/09

  • Initial release.

External links

Advertising: