I need to downsize a large amount of files. There is a main folder and in this folder there is also many subfolders. File types are jpg and png and they should be the same after saving them in lower quality. I just used the option to set lower quality for jpg files and now the problem is that it makes a JPEG folder for each saved file or files. How can I do it without creating a new folder for saved files and just overwrite the existing ones?
The image processor doesn't support saving PNGs or overwriting files. The save options are JPEG, PSD, or TIFF.
The image processor puts the generated image files in a new folder specifically to avoid overwriting the originals. This is an example of Photoshop trying to save you from yourself - overwriting original files is not a good idea!
However, you could create a new destination folder for the output files, select that folder as the destination folder in the image processor, then select the option to "Keep folder structure". At least that way you will get a copy of the folder with the subfolder structure intact, but with the newly processed images.
If you want to overwrite files it's possible to do it with an action, and then run the action using File > Automate > Batch.
If you do use the Batch processor, make sure that you work on a copy of the folder, otherwise once your files are overwritten you won't be able to undo it.