Sometimes you need a high quality icon from Mac System Preferences for a project, but you can't find any good quality on the internet. Fortunately, it is very easy to export a perfect resolution System Preference icon with a transparent background using only the Preview application. Let us see in detail how such a thing can be done.
First, we need to locate the actual files that the prefpanes represent using Finder. With Finder enabled, select Go> Go to Folder from the menu bar at the top of the screen.
In the Go to Folder window or the slider that appears, type (or paste) / System / Library / PreferencePanes.
A Finder window will appear that includes archives corresponding to the prefpanes you see in System Preferences. (Note: If you are looking for a third-party prefpane file, select / Library / PreferencePanes.)
Locate the file that represents the prefpane from which you want to extract an icon. It must have a recognizable name. For example, "PrintAndScan.prefPane" is the file for "Printers and Scanners" and "SoftwareUpdate.prefPane" is the file for "Update" software".
Each ".prefPane" file is actually a special type of folder called a "package". We will open this package and see the resources it contains.
Once you find the prefpane file, right click and select "Show Package Contents".
The application package will open and you will see a "Contents" folder. Open it and in "Contents" you will find many folders and archives. Locate the "Resources" folder and open it.
Navigate to the Resources folder and look for a ".icns" file with a similar name to the "preference pane" you are looking at. For example, "SoftwareUpdate.prefPane" includes a file called "SoftwareUpdate.icns." This is a file containing different icons size for the prefpane. Double-click on it and it will open in the preview.
In the preview, you will see that the ".icns" file contains many icons sizes. The largest will be at the top of the list in the window on the left. Click to select it.
After selecting the largest icon, click File> Export in the menu bar.
When the Export dialog box appears, enter a file name and select where you want to save it. Next, you need to decide on an image format. If you want the highest quality image with a transparent background, select “PNG” from the list. Make sure "Alpha" is selected because it ensures that PNG will have a transparent background.)
Then click "Save".
The preview will save the icon you selected as a transparent PNG file. After that, close the preview and you will find the new PNG file where you saved it.
Photo source: howtogeek.com