Capture and Share Screenshots Like a Pro with ImageKit
ScreenToImageKit is a simple and user-friendly tool that makes capturing and sharing screenshots a breeze. Whether you need to grab a full screen or just a specific area, this application simplifies the process and even leverages the power of Gemini AI to help with file naming. This guide will walk you through the entire process step-by-step.
Pre requisites
Python: version 3.12 or above
Git: any latest available version
Text Editor: VS Code is recommended with Python extension
Windows OS: as of now, I have a plan to implement in other platforms as well
- Installation
There will be an exe file available to download, but windows defender may block you from installing it since I am an unknown publisher, if it works for you, just download and install it, you don’t need any workarounds which we are going to go through below except configuring .env file
Now let’s see the steps to begin with
Before we start capturing, let’s get the application set up on your computer.
- Clone the Repository:
Open your terminal or command prompt and type the following command, then press Enter:
git clone https://github.com/nirzaf/ScreenToImageKit.git
- Next, navigate into the project folder:
cd ScreenToImageKit
- Above commands should download the application files to your computer and enter into the root directory of the project.
- Install Dependencies:
Now, you’ll need to install the necessary components for the application to run. Type the following command and press Enter:
pip install -r requirements.txt
- Run the Application:
Before you run the application you have to configure ImageKit API details and GeminiAI API key, which are explained below in this article how to get them, as of now let's assume you already have them.
You will find the .env.example file in the root of the directory
PRIVATE_KEY=paste_your_imageKit_private_key_here
PUBLIC_KEY=paste_your_imageKit_public_key_here
URL_ENDPOINT=paste_your_imageKit_url_endpoint_here
GEMINI_API_KEY=paste_your_gemini_api_key_here
update with your keys in relevant fields, and rename file as .env
Finally, start the application with this command:
python main.py
- The ScreenToImageKit application window should now open on your screen.
You should see the green text as ImageKit credentials loaded successfully, if you configured the .env file properly once the main form loaded.
2. Configuring ImageKit
ScreenToImageKit uses ImageKit to store your screenshots online. You need to configure your ImageKit credentials. You have two ways to do this.
- Using the UI:
- Click on the “Configure ImageKit” button, usually found at the bottom part of application window, represented by an icon.
You can use the Configure ImageKit, button to configure ImageKit API keys and endpoints, once you click that button you will find the form like below form.
- Enter your ImageKit credentials in the corresponding fields:
Create the free ImageKit account using your email account, and create a folder with name “screenshots” in your Media library section in the ImageKit dashboard
You will find the Developer options in the right side of the dashboard, once you successfully created your account in ImageKit
And then you can find all required details as shown in the below image
- Private Key: This is your ImageKit private key.
- Public Key: This is your ImageKit public key.
- URL Endpoint: This is the ImageKit URL endpoint.
Click the “OK” button to save your credentials. or just paste them in your .env file as we discussed earlier
For
- Gemini API Key: You should have Gmail account to get your Gemini API key, but this is optional, if you don’t need to have a suitable name based on image content you can ignore this step, your image will have some random name
As shown in the above image, you can get your free Gemini API key and paste it in the .env file just right after GEMINI_API_KEY=
Double quotes are not required for all keys
- Now you can load the credentials automatically or manually:
Automatic Load: When you start the app it should load automatically if the file is present in root folder.
Manual Load: Click the “Import from .env” button on main window to manually load credentials incase if it is not loaded for some reason.
3. Capturing Screenshots
ScreenToImageKit provides two ways to capture screenshots: area selection and full screen capture.
Area Selection:
- Click on the “Select Area & Capture” button.
This option provides an option to define the area you want to capture through dragging your mouse pointer, it will automatically capture the selected area. - Your screen will dim and you’ll see a red rectangle appearing.
- Click and drag your mouse to draw a rectangle around the area you want to capture.
- Release the mouse button when you have selected the desired area.
Full Screen Capture:
- Click on the “Capture Full Screen” button.
- The application will hide itself during the capture, so the app itself doesn’t appear in the screenshot.
4. Uploading Screenshots
After capturing a screenshot, you have a choice: upload directly or review it first.
- Direct Upload:
- Check the “Upload directly to ImageKit” checkbox.
- When you capture a screenshot, it is automatically uploaded to ImageKit, and the ImageKit link is copied to your clipboard. This link can be used instantly as a CDN source or shared with others effortlessly, eliminating the need for additional steps.
- Preview Window:
- Make sure the “Upload directly to ImageKit” checkbox is unchecked.
- After capturing a screenshot, a preview window will open showing the image.
You can annotate the capture image using few tools available in the preview form, soon this section be improved with more useful tools and improved UI
In the preview window you have option to:
- Click “Upload” button: to upload your screenshot to ImageKit
- Click “X” button: to discard your screenshot
Once upload is completed successfully, the URL will be automatically copied to your clipboard.
5. Quick Capture:
- You can trigger a capture using Ctrl + W hotkey, which will start area selection and upload to Imagekit automatically, it also copies the URL to clipboard as usual.
6. Gemini AI Integration
- Once screenshot is taken the captured image is sent to Gemini AI API, for description.
- The file is renamed based on the description by Gemini AI.
- Spaces in the description are replaced with underscores before using as a filename.
- This feature is done automatically for every screenshot captured.
7. System Tray
- The application has a system tray icon, usually at the right corner of the screen on your task bar.
- You can access main application features from the system tray menu, such as show main window, capture or configure ImageKit.
Important Considerations
- Clipboard Integration: After each successful upload, the image URL is automatically copied to your clipboard, making it easy to share.
- Resource Management: ScreenToImageKit automatically cleans up temporary files during startup and shutdown to keep your system tidy.
- Gemini API Key: You need to create a Google Gemini API Key to use AI naming strategy.
- Error Messages: If you encounter any issues, check the application’s status label for informative messages.
- Status Messages: Use the success label in the bottom of main window to verify status of upload and copy URL to clipboard.
Conclusion
ScreenToImageKit simplifies the process of capturing, uploading, and sharing screenshots. Whether you’re a beginner or an advanced user, this tool is designed to be user-friendly and efficient. With direct upload, a preview option, and Gemini AI integration, you’ll find ScreenToImageKit an invaluable part of your workflow. This is just the beginning of this project, please stay tuned for more features to be released gradually, please provide your any feedback, bugs reporting while you are using this application, also welcome to contribution from python developers to contribute to this Open-Source project. If you find this app useful giving a star in to this repo would be really encouraging to improve this project continuously.